summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2014-05-17 18:34:23 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-06-03 13:43:25 +0200
commiteb774aff170b3ea671dacaf50aee5595cce1ae9a (patch)
treeeaa339e57e698c6e50895058dccffae9bc8f94d6
parent4d2d5690159a0ccc281e53951981a5c0f1641eee (diff)
downloadsssd-eb774aff170b3ea671dacaf50aee5595cce1ae9a.tar.gz
sssd-eb774aff170b3ea671dacaf50aee5595cce1ae9a.tar.xz
sssd-eb774aff170b3ea671dacaf50aee5595cce1ae9a.zip
CRYPTO: Use unprefixed version of function stpncpy
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 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 83e1ea9e24aabe6ade180649ecfc9c253ad19395)
-rw-r--r--src/util/crypto/libcrypto/crypto_sha512crypt.c4
-rw-r--r--src/util/crypto/nss/nss_sha512crypt.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/util/crypto/libcrypto/crypto_sha512crypt.c b/src/util/crypto/libcrypto/crypto_sha512crypt.c
index 88628b686..34547d08a 100644
--- a/src/util/crypto/libcrypto/crypto_sha512crypt.c
+++ b/src/util/crypto/libcrypto/crypto_sha512crypt.c
@@ -266,7 +266,7 @@ static int sha512_crypt_r(const char *key,
goto done;
}
- cp = __stpncpy(buffer, sha512_salt_prefix, SALT_PREF_SIZE);
+ cp = stpncpy(buffer, sha512_salt_prefix, SALT_PREF_SIZE);
buflen -= SALT_PREF_SIZE;
if (rounds_custom) {
@@ -284,7 +284,7 @@ static int sha512_crypt_r(const char *key,
ret = ERANGE;
goto done;
}
- cp = __stpncpy(cp, salt, salt_len);
+ cp = stpncpy(cp, salt, salt_len);
*cp++ = '$';
buflen -= salt_len + 1;
diff --git a/src/util/crypto/nss/nss_sha512crypt.c b/src/util/crypto/nss/nss_sha512crypt.c
index 2838c4716..9fedd5ec6 100644
--- a/src/util/crypto/nss/nss_sha512crypt.c
+++ b/src/util/crypto/nss/nss_sha512crypt.c
@@ -267,7 +267,7 @@ static int sha512_crypt_r(const char *key,
goto done;
}
- cp = __stpncpy(buffer, sha512_salt_prefix, SALT_PREF_SIZE);
+ cp = stpncpy(buffer, sha512_salt_prefix, SALT_PREF_SIZE);
buflen -= SALT_PREF_SIZE;
if (rounds_custom) {
@@ -285,7 +285,7 @@ static int sha512_crypt_r(const char *key,
ret = ERANGE;
goto done;
}
- cp = __stpncpy(cp, salt, salt_len);
+ cp = stpncpy(cp, salt, salt_len);
*cp++ = '$';
buflen -= salt_len + 1;