[SCM] UNNAMED PROJECT - branch master updated - 4c006c675d577d4a45f4db2929af6d50bc28dd9e

Ronnie Sahlberg sahlberg at samba.org
Thu Apr 3 00:02:32 GMT 2008


The branch, master has been updated
       via  4c006c675d577d4a45f4db2929af6d50bc28dd9e (commit)
      from  794ed5852c09deaffd1817f8a443b4711ed4d06f (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4c006c675d577d4a45f4db2929af6d50bc28dd9e
Author: Ronnie Sahlberg <sahlberg at samba.org>
Date:   Thu Apr 3 10:58:51 2008 +1100

    From Chris Cowan
    
    Add support in AIX to track the PID of a client that connects to the unix domain socket

-----------------------------------------------------------------------

Summary of changes:
 server/ctdb_daemon.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index 900d4e8..3ba5998 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -529,8 +529,13 @@ static void ctdb_accept_client(struct event_context *ev, struct fd_event *fde,
 	int fd;
 	struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
 	struct ctdb_client *client;
+#ifdef _AIX
+	struct peercred_struct cr;
+	socklen_t crl = sizeof(struct peercred_struct);
+#else
 	struct ucred cr;
 	socklen_t crl = sizeof(struct ucred);
+#endif
 
 	memset(&addr, 0, sizeof(addr));
 	len = sizeof(addr);
@@ -543,7 +548,11 @@ static void ctdb_accept_client(struct event_context *ev, struct fd_event *fde,
 	set_close_on_exec(fd);
 
 	client = talloc_zero(ctdb, struct ctdb_client);
+#ifdef _AIX
+	if (getsockopt(fd, SOL_SOCKET, SO_PEERID, &cr, &crl) == 0) {
+#else
 	if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crl) == 0) {
+#endif
 		talloc_asprintf(client, "struct ctdb_client: pid:%u", (unsigned)cr.pid);
 	}
 


-- 
UNNAMED PROJECT


More information about the samba-cvs mailing list