summaryrefslogtreecommitdiff
path: root/lib/util
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/util
parent76bb68fd2b9e09eb4c033417f0f1174f18c04797 (diff)
downloadsamba-71d41a015add73e0fb355dd9713e99febd71d46f.tar.gz
samba-71d41a015add73e0fb355dd9713e99febd71d46f.tar.bz2
samba-71d41a015add73e0fb355dd9713e99febd71d46f.zip
libreplace: Add getpeereid implementation.
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/samba_util.h2
-rw-r--r--lib/util/system.c29
2 files changed, 0 insertions, 31 deletions
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 0c3fd1aeaf..f989231102 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -123,8 +123,6 @@ _PUBLIC_ pid_t sys_fork(void);
**/
_PUBLIC_ pid_t sys_getpid(void);
-_PUBLIC_ int sys_getpeereid( int s, uid_t *uid);
-
struct sockaddr;
_PUBLIC_ int sys_getnameinfo(const struct sockaddr *psa,
diff --git a/lib/util/system.c b/lib/util/system.c
index a7141bf9b0..f34fabd292 100644
--- a/lib/util/system.c
+++ b/lib/util/system.c
@@ -71,35 +71,6 @@ _PUBLIC_ pid_t sys_getpid(void)
}
-_PUBLIC_ int sys_getpeereid( int s, uid_t *uid)
-{
-#if defined(HAVE_PEERCRED)
- struct ucred cred;
- socklen_t cred_len = sizeof(struct ucred);
- int ret;
-
- ret = getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void *)&cred, &cred_len);
- if (ret != 0) {
- return -1;
- }
-
- if (cred_len != sizeof(struct ucred)) {
- errno = EINVAL;
- return -1;
- }
-
- *uid = cred.uid;
- return 0;
-#else
-#if defined(HAVE_GETPEEREID)
- gid_t gid;
- return getpeereid(s, uid, &gid);
-#endif
- errno = ENOSYS;
- return -1;
-#endif
-}
-
_PUBLIC_ int sys_getnameinfo(const struct sockaddr *psa,
int salen,
char *host,