dovecot-2.1: Compile fix for OpenBSD.
dovecot at dovecot.org
dovecot at dovecot.org
Mon Sep 19 18:29:06 EEST 2011
details: http://hg.dovecot.org/dovecot-2.1/rev/97135a53951e
changeset: 13514:97135a53951e
user: Timo Sirainen <tss at iki.fi>
date: Mon Sep 19 18:28:14 2011 +0300
description:
Compile fix for OpenBSD.
diffstat:
src/lib/network.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (33 lines):
diff -r ee36cef69246 -r 97135a53951e src/lib/network.c
--- a/src/lib/network.c Mon Sep 19 14:25:29 2011 +0300
+++ b/src/lib/network.c Mon Sep 19 18:28:14 2011 +0300
@@ -697,7 +697,14 @@
int net_getunixcred(int fd, struct net_unix_cred *cred_r)
{
-#if defined(SO_PEERCRED)
+#if defined(HAVE_GETPEEREID)
+ /* OSX 10.4+, FreeBSD 4.6+, OpenBSD 3.0+, NetBSD 5.0+ */
+ if (getpeereid(fd, &cred_r->uid, &cred_r->gid) < 0) {
+ i_error("getpeereid() failed: %m");
+ return -1;
+ }
+ return 0;
+#elif defined(SO_PEERCRED)
/* Linux */
struct ucred ucred;
socklen_t len = sizeof(ucred);
@@ -709,13 +716,6 @@
cred_r->uid = ucred.uid;
cred_r->gid = ucred.gid;
return 0;
-#elif defined(HAVE_GETPEEREID)
- /* OSX 10.4+, FreeBSD 4.6+, OpenBSD 3.0+, NetBSD 5.0+ */
- if (getpeereid(fd, &cred_r->uid, &cred_r->gid) < 0) {
- i_error("getpeereid() failed: %m");
- return -1;
- }
- return 0;
#elif defined(HAVE_GETPEERUCRED)
/* Solaris */
ucred_t *ucred;
More information about the dovecot-cvs
mailing list