[Pkg-shadow-commits] r1347 - in upstream/trunk: . libmisc

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Fri Nov 16 12:36:22 UTC 2007


Author: nekral-guest
Date: 2007-11-16 12:36:21 +0000 (Fri, 16 Nov 2007)
New Revision: 1347

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/configure.in
   upstream/trunk/libmisc/salt.c
Log:
Add support for uClibc with no l64a().


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2007-11-16 11:32:42 UTC (rev 1346)
+++ upstream/trunk/ChangeLog	2007-11-16 12:36:21 UTC (rev 1347)
@@ -1,5 +1,11 @@
 2007-11-16  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* configure.in: Check if the l64a function exists instead of a64l
+	which we do not use.
+	* libmisc/salt.c: Add support for uClibc with no l64a().
+
+2007-11-16  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* configure.in: Check if the netdb.h header file and the innetgr
 	function exist.
 	* src/login_nopam.c, NEWS: Add support for systems with no

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2007-11-16 11:32:42 UTC (rev 1346)
+++ upstream/trunk/NEWS	2007-11-16 12:36:21 UTC (rev 1347)
@@ -19,6 +19,7 @@
   systems, username with an @ will be treated like any other username
   (i.e. lookup in the local database for an user with an @). Thanks to
   Mike Frysinger for the patch.
+- Add support for uClibc with no l64a().
 
 shadow-4.0.18.1 -> shadow-4.0.18.2					28-10-2007
 

Modified: upstream/trunk/configure.in
===================================================================
--- upstream/trunk/configure.in	2007-11-16 11:32:42 UTC (rev 1346)
+++ upstream/trunk/configure.in	2007-11-16 12:36:21 UTC (rev 1347)
@@ -34,7 +34,7 @@
 	utime.h ulimit.h sys/resource.h gshadow.h shadow.h lastlog.h \
 	locale.h rpc/key_prot.h netdb.h)
 
-AC_CHECK_FUNCS(a64l fchmod fchown fsync getgroups gethostname getspnam \
+AC_CHECK_FUNCS(l64a fchmod fchown fsync getgroups gethostname getspnam \
 	gettimeofday getusershell getutent initgroups lchown lckpwdf lstat \
 	memcpy memset setgroups sigaction strchr updwtmp updwtmpx innetgr)
 AC_SYS_LARGEFILE

Modified: upstream/trunk/libmisc/salt.c
===================================================================
--- upstream/trunk/libmisc/salt.c	2007-11-16 11:32:42 UTC (rev 1346)
+++ upstream/trunk/libmisc/salt.c	2007-11-16 12:36:21 UTC (rev 1347)
@@ -3,6 +3,8 @@
  *
  * Written by Marek Michalkiewicz <marekm at i17linuxb.ists.pwr.wroc.pl>,
  * public domain.
+ *
+ * l64a was Written by J.T. Conklin <jtc at netbsd.org>. Public domain.
  */
 
 #include <config.h>
@@ -14,6 +16,42 @@
 #include "prototypes.h"
 #include "defines.h"
 #include "getdef.h"
+
+#ifndef HAVE_L64A
+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 /* !HAVE_L64A */
+
 /*
  * Generate 8 base64 ASCII characters of random salt.  If MD5_CRYPT_ENAB
  * in /etc/login.defs is "yes", the salt string will be prefixed by "$1$"




More information about the Pkg-shadow-commits mailing list