[PATCH] Make libreplace a no-op on Linux

Jelmer Vernooij jelmer at samba.org
Wed Nov 21 07:22:21 MST 2012


On Wed, Nov 21, 2012 at 03:16:41PM +0100, Andreas Schneider wrote:
> 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.
If getpass() is deprecated, then we should probably introduce an
alternative under a different name and just avoid 'getpass' altogether.
In that case it should probably live in libutil rather than
libreplace, too.

Using the code from libssh for that seems like a good idea.

Cheers,

Jelmer


More information about the samba-technical mailing list