nfs4: Support legacy owner and owner_group values

This commit is contained in:
Pawel Dziepak
2012-07-03 22:08:35 +02:00
parent 6197fa881f
commit 16ff38f828
@@ -9,6 +9,7 @@
#include "Inode.h"
#include <ctype.h>
#include <string.h>
#include <NodeMonitor.h>
@@ -547,14 +548,20 @@ Inode::Stat(struct stat* st)
if (count >= next && values[next].fAttribute == FATTR4_OWNER) {
char* owner = reinterpret_cast<char*>(values[next].fData.fPointer);
st->st_uid = gIdMapper->GetUserId(owner);
if (owner != NULL && isdigit(owner[0]))
st->st_uid = atoi(owner);
else
st->st_uid = gIdMapper->GetUserId(owner);
next++;
} else
st->st_uid = 0;
if (count >= next && values[next].fAttribute == FATTR4_OWNER_GROUP) {
char* group = reinterpret_cast<char*>(values[next].fData.fPointer);
st->st_gid = gIdMapper->GetGroupId(group);
if (group != NULL && isdigit(group[0]))
st->st_gid = atoi(group);
else
st->st_gid = gIdMapper->GetGroupId(group);
next++;
} else
st->st_gid = 0;