OpenBSD: SO_PEERCRED requires the sockpeercred struct #4196

Closed
michaelrsweet opened this Issue Sep 30, 2012 · 2 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Sep 30, 2012

Version: 1.6.1
CUPS.org User: ajacoutot

Hi.

On OpenBSD, SO_PEERCRED needs the sockpeercred structure and not ucred.
The attached patch fixes the build for me.
Thank you.

Collaborator

michaelrsweet commented Oct 1, 2012

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Oct 1, 2012

"patch-scheduler_auth_c":

--- scheduler/auth.c.orig Wed Aug 31 06:58:33 2011
+++ scheduler/auth.c Wed Jul 25 17:28:20 2012
@@ -89,7 +89,11 @@ extern const char _cssmErrorString(int error);
typedef struct xucred cupsd_ucred_t;

define CUPSD_UCRED_UID(c) (c).cr_uid

#else
+# ifndef OpenBSD
typedef struct ucred cupsd_ucred_t;
+# else
+typedef struct sockpeercred cupsd_ucred_t;
+# endif

define CUPSD_UCRED_UID(c) (c).uid

#endif /_ HAVE_SYS_UCRED_H */
#ifdef HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment