]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Assume l64a(3) exists
authorAlejandro Colomar <alx@kernel.org>
Fri, 2 Dec 2022 21:28:25 +0000 (22:28 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 15 Dec 2022 22:22:05 +0000 (16:22 -0600)
It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
libmisc/salt.c

index ae43b9b15eb07fb3f7f0cdcd9e49b4742b50d1f5..ebb3b1b0c4366c84c313c22b2776d1c03ce31b6a 100644 (file)
@@ -45,7 +45,7 @@ AC_CHECK_HEADERS(crypt.h utmp.h \
 dnl shadow now uses the libc's shadow implementation
 AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
 
-AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes \
+AC_CHECK_FUNCS(arc4random_buf fchmod fchown fsync futimes \
        getentropy getrandom getspnam getusershell \
        getutent initgroups lckpwdf lutimes \
        setgroups updwtmp updwtmpx innetgr getpwnam_r \
index e5f633ab9804a34ba4cffc5c34e6f7506831835a..0aeff738b50c01f4e89732b34526200832d8726b 100644 (file)
@@ -10,8 +10,6 @@
  *
  * Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>,
  * it is in the public domain.
- *
- * l64a was Written by J.T. Conklin <jtc@netbsd.org>. Public domain.
  */
 
 #include <config.h>
@@ -111,42 +109,6 @@ static /*@observer@*/unsigned long YESCRYPT_get_salt_cost (/*@null@*/const int *
 static /*@observer@*/void YESCRYPT_salt_cost_to_buf (char *buf, unsigned long cost);
 #endif /* USE_YESCRYPT */
 
-#if !USE_XCRYPT_GENSALT && !defined(HAVE_L64A)
-static /*@observer@*/char *l64a (long value)
-{
-       static char buf[8];
-       char *s = buf;
-       int digit;
-       int i;
-
-       if (value < 0) {
-               errno = EINVAL;
-               return(NULL);
-       }
-
-       for (i = 0; value != 0 && i < 6; i++) {
-               digit = value & 0x3f;
-
-               if (digit < 2) {
-                       *s = digit + '.';
-               } else if (digit < 12) {
-                       *s = digit + '0' - 2;
-               } else if (digit < 38) {
-                       *s = digit + 'A' - 12;
-               } else {
-                       *s = digit + 'a' - 38;
-               }
-
-               value >>= 6;
-               s++;
-       }
-
-       *s = '\0';
-
-       return buf;
-}
-#endif /* !USE_XCRYPT_GENSALT && !defined(HAVE_L64A) */
-
 /* Read sizeof (long) random bytes from /dev/urandom. */
 static long read_random_bytes (void)
 {