nfs4: Allow WriteStat() to set UID and GID

This commit is contained in:
Pawel Dziepak
2012-07-03 22:00:55 +02:00
parent ed097dd0a2
commit 6197fa881f
+15 -1
View File
@@ -595,7 +595,7 @@ Inode::WriteStat(const struct stat* st, uint32 mask)
{
status_t result;
OpenFileCookie* cookie = NULL;
AttrValue attr[4];
AttrValue attr[6];
uint32 i = 0;
if ((mask & B_STAT_SIZE) != 0) {
@@ -623,6 +623,20 @@ Inode::WriteStat(const struct stat* st, uint32 mask)
i++;
}
if ((mask & B_STAT_UID) != 0) {
attr[i].fAttribute = FATTR4_OWNER;
attr[i].fFreePointer = true;
attr[i].fData.fPointer = gIdMapper->GetOwner(st->st_uid);
i++;
}
if ((mask & B_STAT_GID) != 0) {
attr[i].fAttribute = FATTR4_OWNER_GROUP;
attr[i].fFreePointer = true;
attr[i].fData.fPointer = gIdMapper->GetOwnerGroup(st->st_gid);
i++;
}
if ((mask & B_STAT_ACCESS_TIME) != 0) {
attr[i].fAttribute = FATTR4_TIME_ACCESS_SET;
attr[i].fFreePointer = true;