Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357776
b: refs/heads/master
c: a0a5386
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent 9e6770c commit ee42b8d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f74f70f8b10b435f5f20247e70d1d86b53a59685
refs/heads/master: a0a5386ac6400493cc2eb8b58583e56af0708730
4 changes: 2 additions & 2 deletions trunk/fs/afs/afs.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ struct afs_file_status {
u64 size; /* file size */
afs_dataversion_t data_version; /* current data version */
u32 author; /* author ID */
u32 owner; /* owner ID */
u32 group; /* group ID */
kuid_t owner; /* owner ID */
kgid_t group; /* group ID */
afs_access_t caller_access; /* access rights for authenticated caller */
afs_access_t anon_access; /* access rights for unauthenticated caller */
umode_t mode; /* UNIX mode */
Expand Down
14 changes: 10 additions & 4 deletions trunk/fs/afs/fsclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
umode_t mode;
u64 data_version, size;
u32 changed = 0; /* becomes non-zero if ctime-type changes seen */
kuid_t owner;
kgid_t group;

#define EXTRACT(DST) \
do { \
Expand All @@ -56,7 +58,9 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
size = ntohl(*bp++);
data_version = ntohl(*bp++);
EXTRACT(status->author);
EXTRACT(status->owner);
owner = make_kuid(&init_user_ns, ntohl(*bp++));
changed |= !uid_eq(owner, status->owner);
status->owner = owner;
EXTRACT(status->caller_access); /* call ticket dependent */
EXTRACT(status->anon_access);
EXTRACT(status->mode);
Expand All @@ -65,7 +69,9 @@ static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
bp++; /* seg size */
status->mtime_client = ntohl(*bp++);
status->mtime_server = ntohl(*bp++);
EXTRACT(status->group);
group = make_kgid(&init_user_ns, ntohl(*bp++));
changed |= !gid_eq(group, status->group);
status->group = group;
bp++; /* sync counter */
data_version |= (u64) ntohl(*bp++) << 32;
EXTRACT(status->lock_count);
Expand Down Expand Up @@ -181,12 +187,12 @@ static void xdr_encode_AFS_StoreStatus(__be32 **_bp, struct iattr *attr)

if (attr->ia_valid & ATTR_UID) {
mask |= AFS_SET_OWNER;
owner = attr->ia_uid;
owner = from_kuid(&init_user_ns, attr->ia_uid);
}

if (attr->ia_valid & ATTR_GID) {
mask |= AFS_SET_GROUP;
group = attr->ia_gid;
group = from_kgid(&init_user_ns, attr->ia_gid);
}

if (attr->ia_valid & ATTR_MODE) {
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/afs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static int afs_inode_map_status(struct afs_vnode *vnode, struct key *key)

set_nlink(inode, vnode->status.nlink);
inode->i_uid = vnode->status.owner;
inode->i_gid = 0;
inode->i_gid = GLOBAL_ROOT_GID;
inode->i_size = vnode->status.size;
inode->i_ctime.tv_sec = vnode->status.mtime_server;
inode->i_ctime.tv_nsec = 0;
Expand Down Expand Up @@ -175,8 +175,8 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
inode->i_op = &afs_autocell_inode_operations;
set_nlink(inode, 2);
inode->i_uid = 0;
inode->i_gid = 0;
inode->i_uid = GLOBAL_ROOT_UID;
inode->i_gid = GLOBAL_ROOT_GID;
inode->i_ctime.tv_sec = get_seconds();
inode->i_ctime.tv_nsec = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime;
Expand Down
1 change: 0 additions & 1 deletion trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,6 @@ config UIDGID_CONVERTED
default y

# Filesystems
depends on AFS_FS = n
depends on CIFS = n
depends on CODA_FS = n
depends on GFS2_FS = n
Expand Down

0 comments on commit ee42b8d

Please sign in to comment.