pastebin - collaborative debugging tool
rovema.kpaste.net RSS


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)

  1. # Attempt to set correct user/group for new files
  2. #
  3. # on client:
  4. # $ touch UUUU
  5. #
  6. # idmapd on server sees this;
  7. # 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
  8. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_uid: calling nsswitch->name_to_uid
  9. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nss_getpwnam: name 'openldap@global.loc' domain 'global.loc': resulting localname 'openldap'
  10. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_uid: nsswitch->name_to_uid returned 0
  11. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_uid: final return value is 0
  12. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: Server : (user) name "openldap@global.loc" -> id "123"
  13. # 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
  14. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_gid: calling nsswitch->name_to_gid
  15. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_gid: nsswitch->name_to_gid returned 0
  16. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: nfs4_name_to_gid: final return value is 0
  17. # Oct 11 16:29:32 derfwpc5131 rpc.idmapd[2054700]: Server : (group) name "openldap@global.loc" -> id "131"
  18. #
  19. # but ls -l returns this:
  20. # root@derfwpc5131:~# ls -l  /home/rmainz/tmp/allwrite/UUUUU
  21. # -rw-r--r-- 1 nobody 4294967294 0 Oct 11 16:34 /home/rmainz/tmp/allwrite/UUUUU
  22.  
  23. diff --git a/daemon/open.c b/daemon/open.c
  24. index e59939b..da33737 100644
  25. --- a/daemon/open.c
  26. +++ b/daemon/open.c
  27. @@ -787,6 +787,11 @@ static int handle_open(nfs41_upcall *upcall)
  28.          createattrs.attrmask.count = 2;
  29.          createattrs.attrmask.arr[0] = FATTR4_WORD0_HIDDEN | FATTR4_WORD0_ARCHIVE;
  30.          createattrs.attrmask.arr[1] = FATTR4_WORD1_MODE | FATTR4_WORD1_SYSTEM;
  31. +#if 1
  32. +        createattrs.attrmask.arr[1] |= FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
  33. +        createattrs.owner = "openldap@global.loc";
  34. +        createattrs.owner_group = "openldap@global.loc";
  35. +#endif
  36.          createattrs.mode = args->mode;
  37.          createattrs.hidden = args->file_attrs & FILE_ATTRIBUTE_HIDDEN ? 1 : 0;
  38.          createattrs.system = args->file_attrs & FILE_ATTRIBUTE_SYSTEM ? 1 : 0;

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at