[PATCH] Make libreplace a no-op on Linux

Andreas Schneider asn at samba.org
Wed Nov 21 07:16:41 MST 2012


On Tuesday 20 November 2012 11:18:07 Andrew Bartlett wrote:
> Jelmer,
> 
> I know for a long time you have been trying to make libreplace a no-op
> on Linux.  This came up for me recently when on Debian Wheezy and Ubuntu
> 12.04 my build of Samba 4.0 using this configure command failed:
> 
> ./configure --builtin-libraries=replace,ccan
> --bundled-libraries=pytevent,iniparser
> 
> The errors were due to something not working in the conversion of
> libreplace into a builtin library, but this seems to be both the correct
> and simpler fix.
> 
> [3388/3906] Linking default/source4/heimdal_build/libkrb5-samba4.so
> default/source4/heimdal/lib/krb5/auth_context_55.o: In function
> `krb5_auth_con_genaddrs':
> auth_context.c:(.text+0x5d0): undefined reference to `rep_strerror_r'
> auth_context.c:(.text+0x6ea): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o: In function `_krb5_xlock':
> fcache.c:(.text+0x12e): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o: In function
> `_krb5_xunlock':
> fcache.c:(.text+0x21a): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o: In function `fcc_open':
> fcache.c:(.text+0xb5e): undefined reference to `rep_strerror_r'
> default/source4/heimdal/lib/krb5/fcache_55.o:fcache.c:(.text+0xf32):
> more undefined references to `rep_strerror_r' follow
> collect2: ld returned 1 exit status
> 
> The first patch should ensure we only replace strerror_r (which is only
> used by Heimdal anyway) on systems that really need it, and we have a
> way to override our preference for our replacement getpass().  The
> STRERROR_R_PROTO_COMPATIBLE is only set by roken.h, not configure.
> 
> I'm not totally happy with adding --without-getpass-replacement, but it
> seems the best way can do for now.

Do you know that the getpass() function is deprecated since quite some time.

>From the manpage:

DESCRIPTION
       This function is obsolete.  Do not use it.

So it should be implemented by us (probably not in libreplace).

Feel free to use:

http://git.libssh.org/projects/libssh.git/tree/src/getpass.c

You can relicense to GPLv3 or LGPLv3. It is known to be working on Linux, 
OpenIndiana and FreeBSD.


	-- andreas

-- 
Andreas Schneider                   GPG-ID: F33E3FC6
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list