Bug 18173

Summary: Can not build on Solaris pam
Product: ConsoleKit Reporter: Halton Huo <halton.huo>
Component: DaemonAssignee: william.jon.mccann
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: high CC: brian.cameron
Version: unspecified   
Hardware: All   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Attachments: patch for bug #18173

Description Halton Huo 2008-10-22 01:36:07 UTC
I'm building ConsoleKit 0.3.0 tarball release and trunk code under OpenSolaris
with sun cc, will fails on pam-ck-connector.c with following errors:

/ws/onnv-tools-prc/SUNWspro/SS12/bin/cc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I../libck-connector -g -c pam-ck-connector.c  -KPIC -DPIC -o .libs/pam-ck-connector.o
"/usr/include/security/pam_modules.h", line 38: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 45: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 52: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 59: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 66: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 80: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 92: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 95: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 96: function cannot return function or array
"/usr/include/security/pam_modules.h", line 104: syntax error before or at: *
"pam-ck-connector.c", line 55: cannot find include file: <security/_pam_macros.h>
"pam-ck-connector.c", line 74: warning: no explicit type given
"pam-ck-connector.c", line 74: syntax error before or at: *
"pam-ck-connector.c", line 75: warning: undefined or missing type for: int
"pam-ck-connector.c", line 76: warning: undefined or missing type for: const
"pam-ck-connector.c", line 77: warning: undefined or missing type for: va_list
"pam-ck-connector.c", line 91: undefined symbol: pamh
"pam-ck-connector.c", line 92: warning: implicit function declaration: pam_get_item
"pam-ck-connector.c", line 92: undefined symbol: PAM_SERVICE
"pam-ck-connector.c", line 93: undefined symbol: PAM_SUCCESS
"pam-ck-connector.c", line 111: undefined symbol: fmt
"pam-ck-connector.c", line 111: undefined symbol: args
"pam-ck-connector.c", line 111: warning: improper pointer/integer combination: arg #3
"pam-ck-connector.c", line 111: warning: improper pointer/integer combination: arg #4
"pam-ck-connector.c", line 117: undefined symbol: priority
"pam-ck-connector.c", line 121: warning: no explicit type given
"pam-ck-connector.c", line 121: syntax error before or at: *
"pam-ck-connector.c", line 122: warning: undefined or missing type for: int
"pam-ck-connector.c", line 123: warning: undefined or missing type for: const
"pam-ck-connector.c", line 128: undefined symbol: __builtin_va_alist
"pam-ck-connector.c", line 129: undefined symbol: pamh
"pam-ck-connector.c", line 129: undefined symbol: priority
"pam-ck-connector.c", line 129: undefined symbol: fmt
"pam-ck-connector.c", line 137: warning: no explicit type given
"pam-ck-connector.c", line 137: syntax error before or at: *
"pam-ck-connector.c", line 138: warning: undefined or missing type for: int
"pam-ck-connector.c", line 139: warning: undefined or missing type for: int
"pam-ck-connector.c", line 140: warning: undefined or missing type for: const
"pam-ck-connector.c", line 145: undefined symbol: argc
"pam-ck-connector.c", line 145: undefined symbol: argv
"pam-ck-connector.c", line 145: cannot dereference non-pointer type
"pam-ck-connector.c", line 146: cannot dereference non-pointer type
"pam-ck-connector.c", line 146: warning: improper pointer/integer combination: arg #1
"pam-ck-connector.c", line 149: undefined symbol: pamh
"pam-ck-connector.c", line 149: cannot dereference non-pointer type
"pam-ck-connector.c", line 155: warning: old-style declaration or incorrect type for: PAM_EXTERN
"pam-ck-connector.c", line 155: syntax error before or at: int
"pam-ck-connector.c", line 156: syntax error before or at: *
"pam-ck-connector.c", line 157: warning: undefined or missing type for: int
"pam-ck-connector.c", line 158: warning: undefined or missing type for: int
"pam-ck-connector.c", line 159: warning: undefined or missing type for: const
"pam-ck-connector.c", line 161: undefined symbol: PAM_IGNORE
"pam-ck-connector.c", line 164: warning: old-style declaration or incorrect type for: PAM_EXTERN
"pam-ck-connector.c", line 164: syntax error before or at: int
"pam-ck-connector.c", line 165: syntax error before or at: *
"pam-ck-connector.c", line 166: warning: undefined or missing type for: int
"pam-ck-connector.c", line 167: warning: undefined or missing type for: int
"pam-ck-connector.c", line 168: warning: undefined or missing type for: const
"pam-ck-connector.c", line 170: undefined symbol: PAM_IGNORE
"pam-ck-connector.c", line 188: prototype mismatch: 5 args passed, 4 expected
"pam-ck-connector.c", line 188: warning: improper pointer/integer combination: op "="
"pam-ck-connector.c", line 206: warning: old-style declaration or incorrect type for: PAM_EXTERN
"pam-ck-connector.c", line 206: syntax error before or at: int
"pam-ck-connector.c", line 207: syntax error before or at: *
"pam-ck-connector.c", line 208: warning: undefined or missing type for: int
"pam-ck-connector.c", line 209: warning: undefined or missing type for: int
"pam-ck-connector.c", line 210: warning: undefined or missing type for: const
"pam-ck-connector.c", line 216: undefined symbol: PAM_SUCCESS
"pam-ck-connector.c", line 219: warning: old-style declaration or incorrect type for: PAM_EXTERN
"pam-ck-connector.c", line 219: syntax error before or at: int
"pam-ck-connector.c", line 220: syntax error before or at: *
"pam-ck-connector.c", line 221: warning: undefined or missing type for: int
"pam-ck-connector.c", line 222: warning: undefined or missing type for: int
"pam-ck-connector.c", line 223: warning: undefined or missing type for: const
"pam-ck-connector.c", line 235: undefined symbol: PATH_MAX
"pam-ck-connector.c", line 239: undefined symbol: PAM_IGNORE
"pam-ck-connector.c", line 243: undefined symbol: pamh
"pam-ck-connector.c", line 243: undefined symbol: flags
"pam-ck-connector.c", line 243: undefined symbol: argc
"pam-ck-connector.c", line 243: undefined symbol: argv
"pam-ck-connector.c", line 263: warning: implicit function declaration: pam_get_user
"pam-ck-connector.c", line 264: undefined symbol: PAM_SUCCESS
"pam-ck-connector.c", line 270: undefined symbol: PAM_TTY
"pam-ck-connector.c", line 271: undefined symbol: PAM_SUCCESS
"pam-ck-connector.c", line 288: undefined symbol: PAM_RHOST
"pam-ck-connector.c", line 289: undefined symbol: PAM_SUCCESS
"pam-ck-connector.c", line 297: warning: implicit function declaration: pam_getenv
"pam-ck-connector.c", line 297: warning: improper pointer/integer combination: op "="
"pam-ck-connector.c", line 304: warning: improper pointer/integer combination: op "="
"pam-ck-connector.c", line 312: warning: improper pointer/integer combination: op "="
"pam-ck-connector.c", line 376: warning: implicit function declaration: pam_putenv
"pam-ck-connector.c", line 376: undefined symbol: PAM_SUCCESS
"pam-ck-connector.c", line 395: undefined symbol: PAM_SUCCESS
cc: acomp failed for pam-ck-connector.c
Comment 1 Halton Huo 2008-10-22 02:10:23 UTC
I compared pam headers between Solaris and Ubuntu, I found some differences:

1. Solaris does not ship some headers like: security/_pam_macros.h
   On Ubuntu:
mrbld@yonex:$ ls /usr/include/security/*pam*
pam_appl.h    _pam_compat.h  pam_filter.h   pam_misc.h     pam_modutil.h
pam_client.h  pam_ext.h      _pam_macros.h  pam_modules.h  _pam_types.h

   On Solaris:
$ls /usr/include/security/
auditd.h       pam_appl.h     pkcs11f.h      pkcs11t.h
cryptoki.h     pam_modules.h  pkcs11.h


2. For the same headers pam_appl.h and pam_modules.h, their content are not same between the two systems. 

I'd say to support Solaris, these difference must be considered. Brian already has a patch on http://pkgbuild.svn.sourceforge.net/viewvc/pkgbuild/spec-files-extra/trunk/patches/ConsoleKit-03-pam.diff

I'll work out a patch based on trunk later.
Comment 2 Halton Huo 2008-10-22 03:27:06 UTC
Created attachment 19811 [details] [review]
patch for bug #18173

This patch is a little different with Brian's. Let's me explain the whole patch one by one.

1. pam-ck-connector/Makefile.am (same with Brian's)
   Solaris does not have libpam_misc, so only build test_pam under linux

2. +#include <limits.h>
   This is to get macro PATH_MAX from system. I think it is better than
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
   On ubuntu, PATH_MAX=4096, on Solaris, PATH_MAX=1024

3. +#include <security/pam_appl.h>
   This is to include declaration of pam_handle_t, to resolve error like:
"/usr/include/security/pam_modules.h", line 38: syntax error before or at: *
"/usr/include/security/pam_modules.h", line 45: syntax error before or at: *

4.-#include <security/_pam_macros.h>
  Solaris does not have this file, I remove it, no more error, seems no use here.

5. +#ifndef PAM_EXTERN ... part
  Solaris PAM_EXTERN marco in pam_modules.h, while Ubuntu has, I just copy the logic from Ubuntu.

6. getpwnam_r part (same with Brian's)
   getpwnam_r() have difference behavior between Solaris and Ubuntu.
Comment 3 Halton Huo 2008-10-22 03:49:32 UTC
I've tested this patch on my OpenSolaris 2008.11 and Ubuntu-intrepid box.
Both build OK. 

BTW, test-pam is avail on Ubuntu, I give a quick test on it, result is GO.
Comment 4 william.jon.mccann 2009-02-11 17:40:41 UTC
Sorry for the long delay.  Thanks for the patch!  Committed to master.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.