Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\open.c Create Date:2022-07-28 20:00:56
Last Modify:2020-03-18 10:16:03 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:chown_common

Proto:static int chown_common(const struct path *path, uid_t user, gid_t group)

Type:int

Parameter:

TypeParameterName
const struct path *path
uid_tuser
gid_tgroup
622  inode = Where the name belongs to - NULL is * negative
623  struct inode * delegated_inode = NULL
629  uid = make_kuid - Map a user-namespace uid pair into a kuid
630  gid = make_kgid(current_user_ns(), group)
632  retry_deleg :
633  ia_valid = ATTR_CTIME
634  If (user != (uid_t) - 1) Then
635  If Not uid_valid(uid) Then Return -EINVAL
637  ia_valid |= ATTR_UID
638  ia_uid = uid
640  If (group != (gid_t) - 1) Then
641  If Not gid_valid(gid) Then Return -EINVAL
643  ia_valid |= ATTR_GID
644  ia_gid = gid
646  If Not S_ISDIR(i_mode) Then ia_valid |= ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV
649  inode_lock(inode)
650  error = security_path_chown(path, uid, gid)
651  If Not error Then error = notify_change(dentry, & newattrs, & delegated_inode)
653  inode_unlock(inode)
654  If delegated_inode Then
655  error = break_deleg_wait( & delegated_inode)
656  If Not error Then Go to retry_deleg
659  Return error
Caller
NameDescribe
do_fchownat
ksys_fchown