nfs4: Do not attempt to set owner, owner_group when not supported
This commit is contained in:
@@ -353,15 +353,19 @@ Inode::CreateLink(const char* name, const char* path, int mode)
|
||||
cattr[i].fData.fValue32 = mode;
|
||||
i++;
|
||||
|
||||
cattr[i].fAttribute = FATTR4_OWNER;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||
i++;
|
||||
if (fFilesystem->IsAttrSupported(FATTR4_OWNER)) {
|
||||
cattr[i].fAttribute = FATTR4_OWNER;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||
i++;
|
||||
}
|
||||
|
||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||
i++;
|
||||
if (fFilesystem->IsAttrSupported(FATTR4_OWNER_GROUP)) {
|
||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||
i++;
|
||||
}
|
||||
|
||||
req.Create(NF4LNK, name, cattr, i, path);
|
||||
|
||||
|
||||
@@ -34,15 +34,19 @@ Inode::CreateDir(const char* name, int mode)
|
||||
cattr[i].fData.fValue32 = mode;
|
||||
i++;
|
||||
|
||||
cattr[i].fAttribute = FATTR4_OWNER;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||
i++;
|
||||
if (fFilesystem->IsAttrSupported(FATTR4_OWNER)) {
|
||||
cattr[i].fAttribute = FATTR4_OWNER;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||
i++;
|
||||
}
|
||||
|
||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||
i++;
|
||||
if (fFilesystem->IsAttrSupported(FATTR4_OWNER_GROUP)) {
|
||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||
i++;
|
||||
}
|
||||
|
||||
req.Create(NF4DIR, name, cattr, i);
|
||||
|
||||
|
||||
@@ -91,15 +91,19 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
|
||||
cattr[i].fData.fValue32 = perms;
|
||||
i++;
|
||||
|
||||
cattr[i].fAttribute = FATTR4_OWNER;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||
i++;
|
||||
if (fFilesystem->IsAttrSupported(FATTR4_OWNER)) {
|
||||
cattr[i].fAttribute = FATTR4_OWNER;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||
i++;
|
||||
}
|
||||
|
||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||
i++;
|
||||
if (fFilesystem->IsAttrSupported(FATTR4_OWNER_GROUP)) {
|
||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||
cattr[i].fFreePointer = true;
|
||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||
i++;
|
||||
}
|
||||
|
||||
req.Open(CLAIM_NULL, cookie->fSequence++, sModeToAccess(mode),
|
||||
cookie->fClientId, OPEN4_CREATE, cookie->fOwnerId, name, cattr,
|
||||
|
||||
Reference in New Issue
Block a user