[Pkg-gnupg-commit] [libassuan] 192/437: 2007-07-08 Marcus Brinkmann <marcus at g10code.de>
Eric Dorland
eric at moszumanska.debian.org
Fri May 22 05:33:42 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libassuan.
commit 12d756396fb2fd7232b7650ebaa41de7da303546
Author: Marcus Brinkmann <mb at g10code.com>
Date: Sun Jul 8 15:53:35 2007 +0000
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.
---
src/ChangeLog | 7 +++++++
src/assuan-connect.c | 6 +++++-
src/assuan-defs.h | 10 ++++++----
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 8879186..9911d55 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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
diff --git a/src/assuan-connect.c b/src/assuan-connect.c
index eba65d2..7328ec4 100644
--- a/src/assuan-connect.c
+++ b/src/assuan-connect.c
@@ -57,10 +57,10 @@ assuan_get_pid (assuan_context_t ctx)
}
+#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 @@ assuan_get_peercred (assuan_context_t ctx, pid_t *pid, uid_t *uid, gid_t *gid)
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 */
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 9ee230d..b1d9f3e 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -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 assuan_context_s
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. */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git
More information about the Pkg-gnupg-commit
mailing list