From: mike Date: Tue, 5 Mar 2013 19:31:19 +0000 (+0000) Subject: Log path and PID of client over domain sockets. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a477c4514a38327e7995ed941c7f9e1fb96b6fd;p=thirdparty%2Fcups.git Log path and PID of client over domain sockets. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10883 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/scheduler/client.c b/scheduler/client.c index 15b65db025..0b26203d4a 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -49,6 +49,9 @@ #include "cupsd.h" +#ifdef __APPLE__ +# include +#endif /* __APPLE__ */ #ifdef HAVE_TCPD_H # include #endif /* HAVE_TCPD_H */ @@ -377,8 +380,31 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */ #ifdef AF_LOCAL if (con->http.hostaddr->addr.sa_family == AF_LOCAL) + { +# ifdef __APPLE__ + socklen_t peersize; /* Size of peer credentials */ + pid_t peerpid; /* Peer process ID */ + char name[256]; /* Name of process */ + + peersize = sizeof(peerpid); + if (!getsockopt(con->http.fd, SOL_LOCAL, LOCAL_PEERPID, &peerpid, + &peersize)) + { + if (!proc_name(peerpid, name, sizeof(name))) + cupsdLogMessage(CUPSD_LOG_DEBUG, + "[Client %d] Accepted from %s (Domain ???[%d])", + con->http.fd, con->http.hostname, (int)peerpid); + else + cupsdLogMessage(CUPSD_LOG_DEBUG, + "[Client %d] Accepted from %s (Domain %s[%d])", + con->http.fd, con->http.hostname, name, (int)peerpid); + } + else +# endif /* __APPLE__ */ + cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Accepted from %s (Domain)", con->http.fd, con->http.hostname); + } else #endif /* AF_LOCAL */ cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Accepted from %s:%d (IPv%d)", diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index 29d3a2568e..f296f2deae 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -391,6 +391,7 @@ cat >/tmp/cups-$user/cupsd.conf <