pastebin - collaborative debugging tool
rovema.kpaste.net RSS


Get owner/owner_group for stat() call
Posted by Anonymous on Mon 9th Oct 2023 06:36
raw | new post

  1. diff --git a/daemon/open.c b/daemon/open.c
  2. index c7bd412..6a36a1b 100644
  3. --- a/daemon/open.c
  4. +++ b/daemon/open.c
  5. @@ -644,6 +644,26 @@ static int handle_open(nfs41_upcall *upcall)
  6.          nfs_to_standard_info(&info, &args->std_info);
  7.          args->mode = info.mode;
  8.          args->changeattr = info.change;
  9. +
  10. +#if 1
  11. +        bitmap4 og_attr_request = { 0 };
  12. +        nfs41_file_info og_info = { 0 };
  13. +        char owner[NFS4_OPAQUE_LIMIT], group[NFS4_OPAQUE_LIMIT];
  14. +        nfsacl41 acl = { 0 };
  15. +
  16. +        /* gisburn: need to cache owner/group information */
  17. +        og_attr_request.count = 2;
  18. +        og_attr_request.arr[1] = FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
  19. +        og_info.owner = owner;
  20. +        og_info.owner_group = group;
  21. +        status = nfs41_getattr(state->session, &state->file, &og_attr_request, &og_info);
  22. +        if (status) {
  23. +            eprintf("get_stat_data: nfs41_cached_getattr() failed with %d\n",
  24. +            status);
  25. +        }
  26. +
  27. +       dprintf(1, "/usr/bin/stat: owner='%s', owner_group='%s'\n", og_info.owner, og_info.owner_group);
  28. +#endif
  29.      } else {
  30.          nfs41_file_info createattrs = { 0 };
  31.          uint32_t create = 0, createhowmode = 0, lookup_status = status;

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