You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
934 B

  1. --- a/src/common/sr_utils.c
  2. +++ b/src/common/sr_utils.c
  3. @@ -506,14 +506,24 @@ sr_fd_set_nonblock(int fd)
  4. #if defined(SO_PEERCRED)
  5. +#if defined(__GLIBC__)
  6. #if !defined(SCM_CREDENTIALS)
  7. -/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
  8. struct ucred {
  9. pid_t pid; /* process ID of the sending process */
  10. uid_t uid; /* user ID of the sending process */
  11. gid_t gid; /* group ID of the sending process */
  12. };
  13. #endif /* !defined(SCM_CREDENTIALS) */
  14. +#else
  15. +#if !defined(_GNU_SOURCE)
  16. +struct ucred {
  17. + pid_t pid; /* process ID of the sending process */
  18. + uid_t uid; /* user ID of the sending process */
  19. + gid_t gid; /* group ID of the sending process */
  20. +};
  21. +/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
  22. +#endif /* !defined(__GNU_SOURCE) */
  23. +#endif /* defined(__GLIBC__) */
  24. int
  25. sr_get_peer_eid(int fd, uid_t *uid, gid_t *gid)