[SSSD] [PATCH] CRYPTO: Use unprefixed version of function stpncpy

Jakub Hrozek jakub.hrozek at gmail.com
Sun May 18 03:38:28 UTC 2014


On Sat, 2014-05-17 at 19:35 +0200, Lukas Slebodnik wrote:
> ehlo,
> 
> glibc contains two versions of finction stpncpy
> sh-4.2$ nm --dynamic --defined-only /lib64/libc.so.6 | grep stpncpy
> 0000003ce1c89b00 i stpncpy
> 0000003ce1c89b00 i __stpncpy
> 0000003ce1d040a0 T __stpncpy_chk
> 
> We should use more portable version of stpncpy without prefix with underscores.
> 
> The function __stpncpy was used in initial veersion
> e65c65fc710fa030bfb8319efc43fcdc9ce5a26f, which was based on
> http://people.redhat.com/drepper/SHA-crypt.txt
> 
> patch is simple replacement "s/__stpncpy/stpncpy/"
> 
> LS

Sounds like the right thing do to. I was actually suprised that string.h
had both functions declared, I was expecting one to be just a #define of
the other. But the libc sources indeed only have one definition that
aliases to both stpncpy and __stpncpy (which is also visible from the
addresses of your nm test).

ACK







More information about the sssd-devel mailing list