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;
|
cattr[i].fData.fValue32 = mode;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
cattr[i].fAttribute = FATTR4_OWNER;
|
if (fFilesystem->IsAttrSupported(FATTR4_OWNER)) {
|
||||||
cattr[i].fFreePointer = true;
|
cattr[i].fAttribute = FATTR4_OWNER;
|
||||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
cattr[i].fFreePointer = true;
|
||||||
i++;
|
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
if (fFilesystem->IsAttrSupported(FATTR4_OWNER_GROUP)) {
|
||||||
cattr[i].fFreePointer = true;
|
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
cattr[i].fFreePointer = true;
|
||||||
i++;
|
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
req.Create(NF4LNK, name, cattr, i, path);
|
req.Create(NF4LNK, name, cattr, i, path);
|
||||||
|
|
||||||
|
|||||||
@@ -34,15 +34,19 @@ Inode::CreateDir(const char* name, int mode)
|
|||||||
cattr[i].fData.fValue32 = mode;
|
cattr[i].fData.fValue32 = mode;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
cattr[i].fAttribute = FATTR4_OWNER;
|
if (fFilesystem->IsAttrSupported(FATTR4_OWNER)) {
|
||||||
cattr[i].fFreePointer = true;
|
cattr[i].fAttribute = FATTR4_OWNER;
|
||||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
cattr[i].fFreePointer = true;
|
||||||
i++;
|
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
if (fFilesystem->IsAttrSupported(FATTR4_OWNER_GROUP)) {
|
||||||
cattr[i].fFreePointer = true;
|
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
cattr[i].fFreePointer = true;
|
||||||
i++;
|
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
req.Create(NF4DIR, name, cattr, 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;
|
cattr[i].fData.fValue32 = perms;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
cattr[i].fAttribute = FATTR4_OWNER;
|
if (fFilesystem->IsAttrSupported(FATTR4_OWNER)) {
|
||||||
cattr[i].fFreePointer = true;
|
cattr[i].fAttribute = FATTR4_OWNER;
|
||||||
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
cattr[i].fFreePointer = true;
|
||||||
i++;
|
cattr[i].fData.fPointer = gIdMapper->GetOwner(getuid());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
if (fFilesystem->IsAttrSupported(FATTR4_OWNER_GROUP)) {
|
||||||
cattr[i].fFreePointer = true;
|
cattr[i].fAttribute = FATTR4_OWNER_GROUP;
|
||||||
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
cattr[i].fFreePointer = true;
|
||||||
i++;
|
cattr[i].fData.fPointer = gIdMapper->GetOwnerGroup(getgid());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
req.Open(CLAIM_NULL, cookie->fSequence++, sModeToAccess(mode),
|
req.Open(CLAIM_NULL, cookie->fSequence++, sModeToAccess(mode),
|
||||||
cookie->fClientId, OPEN4_CREATE, cookie->fOwnerId, name, cattr,
|
cookie->fClientId, OPEN4_CREATE, cookie->fOwnerId, name, cattr,
|
||||||
|
|||||||
Reference in New Issue
Block a user