From 6197fa881fea5641fd7c1433c3c1adf27c5d3fdf Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Tue, 3 Jul 2012 22:00:55 +0200 Subject: [PATCH] nfs4: Allow WriteStat() to set UID and GID --- src/add-ons/kernel/file_systems/nfs4/Inode.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/nfs4/Inode.cpp b/src/add-ons/kernel/file_systems/nfs4/Inode.cpp index 3a8a995cad..3286dc6bca 100644 --- a/src/add-ons/kernel/file_systems/nfs4/Inode.cpp +++ b/src/add-ons/kernel/file_systems/nfs4/Inode.cpp @@ -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;