[svn] assuan - r244 - trunk/src

svn author marcus cvs at cvs.gnupg.org
Sun Jul 8 17:54:06 CEST 2007


Author: marcus
Date: 2007-07-08 17:53:35 +0200 (Sun, 08 Jul 2007)
New Revision: 244

Modified:
   trunk/src/ChangeLog
   trunk/src/assuan-connect.c
   trunk/src/assuan-defs.h
Log:
2007-07-08  Marcus Brinkmann  <marcus at g10code.de>

	* assuan-defs.h (struct assuan_context_s): Have full peercred
	structure for HAVE_SO_PEERCRED.
	* assuan-connect.c (assuan_get_peercred) [!HAVE_SO_PEERCRED]: Do
	not try to set PID, UID and GID.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2007-07-05 18:39:02 UTC (rev 243)
+++ trunk/src/ChangeLog	2007-07-08 15:53:35 UTC (rev 244)
@@ -1,3 +1,10 @@
+2007-07-08  Marcus Brinkmann  <marcus at g10code.de>
+
+	* assuan-defs.h (struct assuan_context_s): Have full peercred
+	structure for HAVE_SO_PEERCRED.
+	* assuan-connect.c (assuan_get_peercred) [!HAVE_SO_PEERCRED]: Do
+	not try to set PID, UID and GID.
+
 2007-07-05  Werner Koch  <wk at g10code.com>
 
 	* assuan-defs.h (struct assuan_context_s): Have peercred.valid

Modified: trunk/src/assuan-connect.c
===================================================================
--- trunk/src/assuan-connect.c	2007-07-05 18:39:02 UTC (rev 243)
+++ trunk/src/assuan-connect.c	2007-07-08 15:53:35 UTC (rev 244)
@@ -57,10 +57,10 @@
 }
 
 
+#ifndef HAVE_W32_SYSTEM
 /* Return user credentials. PID, UID and GID amy be gived as NULL if
    you are not interested in this value.  For getting the pid of the
    peer the assuan_get_pid is usually better suited. */
-#ifndef HAVE_W32_SYSTEM
 assuan_error_t
 assuan_get_peercred (assuan_context_t ctx, pid_t *pid, uid_t *uid, gid_t *gid)
 {
@@ -68,12 +68,16 @@
     return _assuan_error (ASSUAN_Invalid_Value);
   if (!ctx->peercred.valid)
     return _assuan_error (ASSUAN_General_Error);
+
+#ifdef HAVE_SO_PEERCRED
   if (pid)
     *pid = ctx->peercred.pid;
   if (uid)
     *uid = ctx->peercred.uid;
   if (gid)
     *gid = ctx->peercred.gid;
+#endif
+
   return 0;
 }
 #endif /* HAVE_W32_SYSTEM */

Modified: trunk/src/assuan-defs.h
===================================================================
--- trunk/src/assuan-defs.h	2007-07-05 18:39:02 UTC (rev 243)
+++ trunk/src/assuan-defs.h	2007-07-08 15:53:35 UTC (rev 244)
@@ -5,7 +5,7 @@
  *
  * Assuan is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 3 of
+ * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * Assuan is distributed in the hope that it will be useful, but
@@ -14,7 +14,9 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
  */
 
 #ifndef ASSUAN_DEFS_H
@@ -140,11 +142,11 @@
 
   struct {
     int valid;   /* Whether this structure has valid information. */
-#ifndef HAVE_W32_SYSTEM
+#ifdef HAVE_SO_PEERCRED
     pid_t pid;     /* The pid of the peer. */
     uid_t uid;     /* The uid of the peer. */
     gid_t gid;     /* The gid of the peer. */
-#endif /* HAVE_W32_SYSTEM */
+#endif /* HAVE_SO_PEERCRED */
   } peercred;
 
   /* Used for Unix domain sockets.  */




More information about the Gnupg-commits mailing list