diff options
Diffstat (limited to 'UNIX/uxpeer.c')
-rw-r--r-- | UNIX/uxpeer.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/UNIX/uxpeer.c b/UNIX/uxpeer.c deleted file mode 100644 index 4ad26322..00000000 --- a/UNIX/uxpeer.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Unix: wrapper for getsockopt(SO_PEERCRED), conditionalised on - * appropriate autoconfery. - */ - -#ifdef HAVE_CONFIG_H -# include "uxconfig.h" /* leading space prevents mkfiles.pl trying to follow */ -#endif - -#ifdef HAVE_SO_PEERCRED -#define _GNU_SOURCE -#include <features.h> -#endif - -#include <sys/socket.h> - -#include "putty.h" - -bool so_peercred(int fd, int *pid, int *uid, int *gid) -{ -#ifdef HAVE_SO_PEERCRED - struct ucred cr; - socklen_t crlen = sizeof(cr); - if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) == 0) { - *pid = cr.pid; - *uid = cr.uid; - *gid = cr.gid; - return true; - } -#endif - return false; -} |