summaryrefslogtreecommitdiff
path: root/lib/replace/wscript
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-24 16:00:36 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-24 16:00:36 +0100
commit71d41a015add73e0fb355dd9713e99febd71d46f (patch)
tree866bc9255d36231a0749a59a05c0eb2d05491836 /lib/replace/wscript
parent76bb68fd2b9e09eb4c033417f0f1174f18c04797 (diff)
downloadsamba-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/wscript10
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