remove getpeereid

This commit is contained in:
Alexandre Ratchov 2011-05-06 13:12:01 +02:00
parent 68f6173228
commit 5f53917840
5 changed files with 2 additions and 27 deletions

View File

@ -32,9 +32,6 @@
#ifdef DEBUG
#include "dbg.h"
#endif
#ifdef COMPAT_GETPEEREID
#include "bsd-compat.h"
#endif
void sock_attach(struct sock *, int);
int sock_read(struct sock *);

View File

@ -32,4 +32,3 @@
long long strtonum(const char *, long long, long long, const char **);
size_t strlcpy(char *, const char *, size_t);
int issetugid(void);
int getpeereid(int, uid_t *, gid_t *);

View File

@ -1,18 +0,0 @@
#ifdef COMPAT_GETPEEREID
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
int
getpeereid(int s, uid_t *ruid, gid_t *rgid)
{
struct ucred cr;
socklen_t len = sizeof(cr);
if (getsockopt(s, SOL_SOCKET, SO_PEERCRED, &cr, &len) < 0)
return -1;
*ruid = cr.uid;
*rgid = cr.gid;
return 0;
}
#endif

2
configure vendored
View File

@ -45,7 +45,7 @@ case `uname` in
alsa=yes
ldadd="-lrt"
so="$so libsndio.so.\${MAJ} libsndio.so"
defs='-DCOMPAT_GETPEEREID -DCOMPAT_ISSETUGID \\\
defs='-DCOMPAT_ISSETUGID \\\
-DCOMPAT_STRLCAT -DCOMPAT_STRLCPY -DCOMPAT_STRTONUM \\\
-DCOMPAT_LETOH -DCOMPAT_PACKED -DDEV_RANDOM=\\"/dev/urandom\\"'
;;

View File

@ -99,7 +99,7 @@ clean:
#
OBJS = debug.o aucat.o \
mio.o mio_rmidi.o mio_aucat.o sio.o sio_alsa.o sio_aucat.o sio_sun.o \
getpeereid.o issetugid.o strlcat.o strlcpy.o strtonum.o
issetugid.o strlcat.o strlcpy.o strtonum.o
.c.o:
${CC} ${CFLAGS} ${SO_CFLAGS} ${INCLUDE} ${DEFS} -o $@ -c $<
@ -113,9 +113,6 @@ libsndio.so.${MAJ}:
libsndio.so:
ln -sf libsndio.so.${MAJ} libsndio.so
getpeereid.o: ../bsd-compat/getpeereid.c
${CC} ${CFLAGS} ${SO_CFLAGS} ${INCLUDE} ${DEFS} -c -o getpeereid.o ../bsd-compat/getpeereid.c
issetugid.o: ../bsd-compat/issetugid.c
${CC} ${CFLAGS} ${SO_CFLAGS} ${INCLUDE} ${DEFS} -c -o issetugid.o ../bsd-compat/issetugid.c