diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-03-24 16:00:36 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-03-24 16:00:36 +0100 |
commit | 71d41a015add73e0fb355dd9713e99febd71d46f (patch) | |
tree | 866bc9255d36231a0749a59a05c0eb2d05491836 /lib/replace/wscript | |
parent | 76bb68fd2b9e09eb4c033417f0f1174f18c04797 (diff) | |
download | samba-71d41a015add73e0fb355dd9713e99febd71d46f.tar.gz samba-71d41a015add73e0fb355dd9713e99febd71d46f.tar.bz2 samba-71d41a015add73e0fb355dd9713e99febd71d46f.zip |
libreplace: Add getpeereid implementation.
Diffstat (limited to 'lib/replace/wscript')
-rw-r--r-- | lib/replace/wscript | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript index e1dc1e6a30..025dda460d 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -174,6 +174,16 @@ def configure(conf): if not conf.CHECK_FUNCS('strlcpy strlcat'): conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', checklibc=True) + if not conf.CHECK_FUNCS('getpeereid'): + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') + + conf.CHECK_CODE(''' + struct ucred cred; + socklen_t cred_len; + int ret = getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);''', + 'HAVE_PEERCRED', + msg="Checking whether we can use SO_PEERCRED to get socket credentials", + headers='sys/types.h sys/socket.h') #Some OS (ie. freebsd) return EINVAL if the convertion could not be done, it's not what we expect #Let's detect those cases |