From 10a0581aeb773c9c517a003eab89d17b52f1bce2 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 4 Sep 2011 08:48:27 +0000 Subject: warn when we couldn't get the gid or pid, the uid is the only really interesting bit git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1535 ef36b2f9-881f-0410-afb5-c4e39611909c --- tests/test_getpeercred.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_getpeercred.c b/tests/test_getpeercred.c index 56bd611..57274b4 100644 --- a/tests/test_getpeercred.c +++ b/tests/test_getpeercred.c @@ -101,6 +101,11 @@ static int open_socket(const char *name) #define SOCKETNAME "/tmp/test_getpeercred.sock" +#define assertwarn(assertion) \ + if (!(assertion)) \ + fprintf(stderr,"test_getpeercred: %s:%d: %s: Assertion `%s' failed\n", \ + __FILE__, __LINE__, __ASSERT_FUNCTION, __STRING(assertion)); + /* the main program... */ int main(int UNUSED(argc),char UNUSED(*argv[])) { @@ -119,8 +124,8 @@ int main(int UNUSED(argc),char UNUSED(*argv[])) /* look up client information */ assert(getpeercred(fsock,&uid,&gid,&pid)==0); assert(uid==geteuid()); - assert(gid==getegid()); - assert(pid==getpid()); + assertwarn(gid==getegid()); + assertwarn(pid==getpid()); /* remove the socket */ unlink(SOCKETNAME); return 0; -- cgit v1.2.3