Summary: | Can not compile with solaris getpwnam_r() | ||
---|---|---|---|
Product: | ConsoleKit | Reporter: | Halton Huo <halton.huo> |
Component: | PAM module | Assignee: | william.jon.mccann |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | medium | CC: | brian.cameron, halfline |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Solaris | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | no difference for getpwnam_r() between Solaris and others |
Description
Halton Huo
2009-06-19 01:16:23 UTC
Created attachment 26949 [details] [review] no difference for getpwnam_r() between Solaris and others Checked solaris pwd.h, uses POSIX getpwnam_r(). 151 #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS) 152 153 #ifdef __PRAGMA_REDEFINE_EXTNAME 154 #pragma redefine_extname getpwuid_r __posix_getpwuid_r 155 #pragma redefine_extname getpwnam_r __posix_getpwnam_r 156 extern int getpwuid_r(uid_t, struct passwd *, char *, int, struct passwd **); 157 extern int getpwnam_r(const char *, struct passwd *, char *, 158 int, struct passwd **); It turns out x11 on Solaris define _POSIX_PTHREAD_SEMANTICS $pkg-config --cflags x11 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -I/usr/X11/include So, we need not "#ifdef __sun .. #else" code in pam-ck-connector.c static uid_t _util_name_to_uid( [...] #ifdef __sun pwdp = getpwnam_r (username, &pwd, buf, bufsize); if (pwdp == NULL) { goto out; } #else rc = getpwnam_r (username, &pwd, buf, bufsize, &pwdp); if (rc != 0 || pwdp == NULL) { goto out; } #endif So the patch is easy to come. This patch is actually revert the change for close bug #18173, the 6. change on comment #2. Committed |
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.