- # Attempt to set correct user/group for new files
- #
- # on client:
- # $ touch UUUU
- #
- # idmapd on server sees this;
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfsdcb: authbuf=fe80::219:99ff:fee6:963f/64,fe80::21b:1bff:fec3:7713/64,fe80::60d8:9f91:d518:3527/64,fe80::6763:10ba:8536:b8af/64,fe80::d6f5:27 authtype=user
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_uid: calling nsswitch->name_to_uid
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nss_getpwnam: name 'openldap@global.loc' domain 'global.loc': resulting localname 'openldap'
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_uid: nsswitch->name_to_uid returned 0
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_uid: final return value is 0
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: Server : (user) name "openldap@global.loc" -> id "123"
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfsdcb: authbuf=fe80::219:99ff:fee6:963f/64,fe80::21b:1bff:fec3:7713/64,fe80::60d8:9f91:d518:3527/64,fe80::6763:10ba:8536:b8af/64,fe80::d6f5:27 authtype=group
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_gid: calling nsswitch->name_to_gid
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_gid: nsswitch->name_to_gid returned 0
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_gid: final return value is 0
- # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: Server : (group) name "openldap@global.loc" -> id "131"
- #
- # but ls -l returns this:
- # root@derfwpc5131:~# ls -l /home/rmainz/tmp/allwrite/UUUUU
- # -rw-r--r-- 1 nobody 4294967294 0 Oct 11 16:34 /home/rmainz/tmp/allwrite/UUUUU
- diff --git a/daemon/open.c b/daemon/open.c
- index e59939b..da33737 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -787,6 +787,11 @@ static int handle_open(nfs41_upcall *upcall)
- createattrs.attrmask.count = 2;
- createattrs.attrmask.arr[0] = FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE;
- createattrs.attrmask.arr[1] = FATTR4_WORD1_MODE | FATTR4_WORD1_SYSTEM;
- +#if 1
- + createattrs.attrmask.arr[1] |= FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
- + createattrs.owner = "openldap@global.loc";
- + createattrs.owner_group = "openldap@global.loc";
- +#endif
- createattrs.mode = args->mode;
- createattrs.hidden = args->file_attrs & FILE_ATTRIBUTE_HIDDEN ? 1 : 0;
- createattrs.system = args->file_attrs & FILE_ATTRIBUTE_SYSTEM ? 1 : 0;
Attempt to set correct user/group for new files
Posted by Anonymous on Wed 11th Oct 2023 15:44
raw | new post
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.