Bug 10850 - lib/nss_wrapper won't compile on Solaris platform
lib/nss_wrapper won't compile on Solaris platform
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other
All Solaris
: P5 critical
: 4.3
Assigned To: Andrew Bartlett
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2014-10-03 15:14 UTC by YOUZHONG YANG
Modified: 2015-03-13 08:41 UTC (History)
4 users (show)

See Also:

patch (7.22 KB, patch)
2014-10-03 18:13 UTC, YOUZHONG YANG
slow: review-
Compiling error on Solaris 11.x (3.94 KB, text/plain)
2015-01-14 19:33 UTC, YOUZHONG YANG
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description YOUZHONG YANG 2014-10-03 15:14:13 UTC
I use the attached patch and it works for us. It might not be the best way to fix it.
Comment 1 Jeremy Allison 2014-10-03 17:06:16 UTC
No patch attached :-). Can you upload it please ?
Comment 2 YOUZHONG YANG 2014-10-03 18:13:39 UTC
Created attachment 10325 [details]
Comment 3 Andreas Schneider 2015-01-09 14:52:47 UTC
Solaris has two different implementations for gethostbyname_r(). We set the correct variables to use the POSIX API and not the SUN API.

 * Defining _POSIX_PTHREAD_SEMANTICS before including pwd.h and grp.h  gives us
 * the posix getpwnam_r(), getpwuid_r(), getgrnam_r and getgrgid_r calls on
 * Solaris

The question is why is this not working for your Solaris. It works just fine with OpenIndiana.
Comment 4 Ralph Böhme 2015-01-14 10:07:36 UTC
Comment on attachment 10325 [details]

Last time I checked master compiles just fine on Solaris (this is Solaris 11.1). Can you check whether this is actually still an issue with master?
Comment 5 YOUZHONG YANG 2015-01-14 19:33:32 UTC
Created attachment 10622 [details]
Compiling error on Solaris 11.x

We are using SmartOS. Today I installed Solaris 11.2 and tried to compile Samba master, it failed for the same reason. 

Please refer to the attached file for more information.


Comment 6 Andreas Schneider 2015-01-23 09:28:31 UTC
Can you please take a look at the header files. Do they contain POSIX versions of gethostbyname_r?
Comment 7 YOUZHONG YANG 2015-01-23 19:31:43 UTC
(In reply to Andreas Schneider from comment #6)

No, Solaris does not have posix definitions of gethostbyname_r and gethostbyaddr_r. 

Please look at the following URL for what they have, although it's from illumos-gate, but the file content is very similar (I have checked on a real Solaris 11.2 installation).