summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Walter <stefw@src.gnome.org>2008-05-18 13:16:53 +0000
committerStefan Walter <stefw@src.gnome.org>2008-05-18 13:16:53 +0000
commit9f111cd774dd0f418906c33b41c00047d5c1d3ff (patch)
tree02f3a7f945b6a16bc82a243eb2e34600977098df
parent71674dc8a71c07815c8a74dc4e0133d31478b1ca (diff)
downloadgnome-keyring-9f111cd774dd0f418906c33b41c00047d5c1d3ff.tar.gz
Add socket credential support for OpenBSD. Patch by Antoine Jacoutot.
* common/gkr-unix-credentials.c: Add socket credential support for OpenBSD. Patch by Antoine Jacoutot. Fixes bug #532143 svn path=/trunk/; revision=1144
-rw-r--r--ChangeLog13
-rw-r--r--common/gkr-unix-credentials.c11
-rw-r--r--configure.in6
3 files changed, 26 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f950eb5..8e6aa080 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,18 @@
2008-05-18 Stef Walter <stef@memberwebs.com>
- * common/gkr-location.c: Fix crash when HAL location volume
- is not registered for some reason. Fixes bug #530316
-
* common/gkr-unix-credentials.c: Fix use of undefined variable
on certain OS's. Patch by Brian Cameron. Fixes bug #530989
* common/gkr-unix-credentials.c: Add additional header for
- building on NetBSD. Patch by Matthias Drochner. Fixes bug #532014
+ building on NetBSD. Patch by Matthias Drochner. Fixes bug #532014
+
+ * common/gkr-unix-credentials.c: Add socket credential support
+ for OpenBSD. Patch by Antoine Jacoutot. Fixes bug #532143
+
+2008-05-18 Stef Walter <stef@memberwebs.com>
+
+ * common/gkr-location.c: Fix crash when HAL location volume
+ is not registered for some reason. Fixes bug #530316
2008-04-29 Stef Walter <stef@memberwebs.com>
diff --git a/common/gkr-unix-credentials.c b/common/gkr-unix-credentials.c
index 143c1613..f77a0720 100644
--- a/common/gkr-unix-credentials.c
+++ b/common/gkr-unix-credentials.c
@@ -127,6 +127,17 @@ gkr_unix_credentials_read (int sock, pid_t *pid, uid_t *uid)
*pid = 0;
*uid = cred->sc_euid;
set_local_creds(sock, FALSE);
+#elif defined(HAVE_GETPEEREID) /* OpenBSD */
+ uid_t euid;
+ gid_t egid;
+ *pid = 0;
+
+ if (getpeereid (fd, &euid, &egid) == 0) {
+ *uid = euid;
+ } else {
+ g_warning ("getpeereid() failed: %s", strerror (errno));
+ return FALSE;
+ }
#elif defined(HAVE_GETPEERUCRED)
ucred_t *uc = NULL;
diff --git a/configure.in b/configure.in
index 65e3d31f..95892dcf 100644
--- a/configure.in
+++ b/configure.in
@@ -142,6 +142,12 @@ fi
AC_CHECK_FUNCS(getpeerucred, AC_DEFINE(HAVE_GETPEERUCRED,1,[Have getpeerucred]))
# --------------------------------------------------------------------
+# Check for getpeereid
+#
+
+AC_CHECK_FUNCS(getpeereid, AC_DEFINE(HAVE_GETPEEREID, 1, [Have getpeereid function]))
+
+# --------------------------------------------------------------------
# Check for flock
#