Bug 10850 - lib/nss_wrapper won't compile on Solaris platform
Summary: lib/nss_wrapper won't compile on Solaris platform
Status: NEEDINFO
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Solaris
: P5 critical (vote)
Target Milestone: 4.3
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-03 15:14 UTC by YOUZHONG YANG
Modified: 2017-04-29 02:56 UTC (History)
5 users (show)

See Also:


Attachments
patch (7.22 KB, patch)
2014-10-03 18:13 UTC, YOUZHONG YANG
slow: review-
Details
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]
patch
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
 */
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS
#endif

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]
patch

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.

Thanks,

-Youzhong
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).

http://src.illumos.org/source/xref/illumos-gate/usr/src/head/netdb.h