]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
* dbus-sysdeps-unix.c (_dbus_set_local_creds): Clean up the
authorJohn (J5) Palmieri <johnp@redhat.com>
Thu, 26 Oct 2006 19:01:10 +0000 (19:01 +0000)
committerJohn (J5) Palmieri <johnp@redhat.com>
Thu, 26 Oct 2006 19:01:10 +0000 (19:01 +0000)
  LOCAL_CREDS vs CMSGCRED stuff a bit.  Prefer CMSGCRED.  This
  needs to be cleaned up more.

* doc/TODO: Add a todo that *BSD hackers should look at cleaning
  up the CREDS issue.

ChangeLog
dbus/dbus-sysdeps-unix.c
doc/TODO

index 3fba2caf3a8eb792cbe436045e5591ac630080b8..9ade28f33b8427b7af07eb0ca8517a4f84f2040a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-26  John (J5) Palmieri  <johnp@redhat.com>
+
+       * dbus-sysdeps-unix.c (_dbus_set_local_creds): Clean up the
+       LOCAL_CREDS vs CMSGCRED stuff a bit.  Prefer CMSGCRED.  This
+       needs to be cleaned up more.
+
+       * doc/TODO: Add a todo that *BSD hackers should look at cleaning
+       up the CREDS issue.
+
 2006-10-26  John (J5) Palmieri  <johnp@redhat.com>
 
        * configure.in, dbus-1.pc.in: Check to see if thread methods 
index 457640506365bc940f83a3845abad3b2c169e35f..75848b71aac6e8cd7a65b849acd9d1a050593817 100644 (file)
@@ -515,7 +515,11 @@ _dbus_set_local_creds (int fd, dbus_bool_t on)
 {
   dbus_bool_t retval = TRUE;
 
-#if defined(LOCAL_CREDS) && !defined(HAVE_CMSGCRED)
+#if defined(HAVE_CMSGCRED)
+  /* NOOP just to make sure only one codepath is used 
+   *      and to prefer CMSGCRED
+   */
+#elif defined(LOCAL_CREDS) 
   int val = on ? 1 : 0;
   if (setsockopt (fd, 0, LOCAL_CREDS, &val, sizeof (val)) < 0)
     {
@@ -828,16 +832,13 @@ write_credentials_byte (int             server_fd,
 {
   int bytes_written;
   char buf[1] = { '\0' };
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+#if defined(HAVE_CMSGCRED) 
   struct {
          struct cmsghdr hdr;
          struct cmsgcred cred;
   } cmsg;
   struct iovec iov;
   struct msghdr msg;
-#endif
-
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
   iov.iov_base = buf;
   iov.iov_len = 1;
 
@@ -857,7 +858,7 @@ write_credentials_byte (int             server_fd,
   
  again:
 
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+#if defined(HAVE_CMSGCRED) 
   bytes_written = sendmsg (server_fd, &msg, 0);
 #else
   bytes_written = write (server_fd, buf, 1);
index 0ede53b85ca527296da2ceae80298ba4716943fe..ca9066805cc3b1ccd674e6cea8fde725b7f91524 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -42,6 +42,10 @@ Might as Well for 1.0
 
 Can Be Post 1.0
 ===
+ - clean up the creds issue on *BSD's in dbus/dbus-sysdeps-unix.c.
+   They should work as is but we need to rearange it to make it
+   clearer which method is being used.  configure.in should
+   be fixed up to make that decition.
 
  - _dbus_connection_unref_unlocked() is essentially always broken because
    the connection finalizer calls non-unlocked functions. One fix is to make