svn commit: [25862] trunk/busybox: libbb loginutils scripts util-linux

vda at busybox.net vda at busybox.net
Sat Mar 28 19:08:24 UTC 2009


Author: vda
Date: 2009-03-28 19:08:23 +0000 (Sat, 28 Mar 2009)
New Revision: 25862

Log:
randomtest fixes



Modified:
   trunk/busybox/libbb/sha1.c
   trunk/busybox/loginutils/adduser.c
   trunk/busybox/scripts/randomtest
   trunk/busybox/util-linux/mkfs_vfat.c


Changeset:
Modified: trunk/busybox/libbb/sha1.c
===================================================================
--- trunk/busybox/libbb/sha1.c	2009-03-28 18:55:46 UTC (rev 25861)
+++ trunk/busybox/libbb/sha1.c	2009-03-28 19:08:23 UTC (rev 25862)
@@ -196,12 +196,11 @@
 
 	/* The actual computation according to FIPS 180-2:6.2.2 step 3.  */
 	for (t = 0; t < 64; ++t) {
-		/* Need to fetch upper half of sha_K[t] */
-#if BB_BIG_ENDIAN
-		uint32_t K_t = ((uint32_t*)(sha_K + t))[0];
-#else
-		uint32_t K_t = ((uint32_t*)(sha_K + t))[1];
-#endif
+		/* Need to fetch upper half of sha_K[t]
+		 * (I hope compiler is clever enough to just fetch
+		 * upper half)
+		 */
+		uint32_t K_t = sha_K[t] >> 32;
 		uint32_t T1 = h + S1(e) + Ch(e, f, g) + K_t + W[t];
 		uint32_t T2 = S0(a) + Maj(a, b, c);
 		h = g;

Modified: trunk/busybox/loginutils/adduser.c
===================================================================
--- trunk/busybox/loginutils/adduser.c	2009-03-28 18:55:46 UTC (rev 25861)
+++ trunk/busybox/loginutils/adduser.c	2009-03-28 19:08:23 UTC (rev 25862)
@@ -89,7 +89,9 @@
 	struct passwd pw;
 	const char *usegroup = NULL;
 	FILE *file;
+#if ENABLE_FEATURE_SHADOWPASSWDS
 	int fd;
+#endif
 
 #if ENABLE_FEATURE_ADDUSER_LONG_OPTIONS
 	applet_long_options = adduser_longopts;

Modified: trunk/busybox/scripts/randomtest
===================================================================
--- trunk/busybox/scripts/randomtest	2009-03-28 18:55:46 UTC (rev 25861)
+++ trunk/busybox/scripts/randomtest	2009-03-28 19:08:23 UTC (rev 25862)
@@ -90,7 +90,7 @@
 # Regenerate .config with default answers for yanked-off options
 { yes "" | make oldconfig >/dev/null; } || exit 1
 
-nice -n 10 make
+nice -n 10 make 2>&1 | tee -a make.log
 
 test -x busybox && {
     cd ..
@@ -99,5 +99,5 @@
 }
 
 cd ..
-mv "$dir" failed."$dir"
+mv "$dir" "failed.$dir"
 exit 1

Modified: trunk/busybox/util-linux/mkfs_vfat.c
===================================================================
--- trunk/busybox/util-linux/mkfs_vfat.c	2009-03-28 18:55:46 UTC (rev 25861)
+++ trunk/busybox/util-linux/mkfs_vfat.c	2009-03-28 19:08:23 UTC (rev 25862)
@@ -323,9 +323,20 @@
 			 * fs size <=  16G: 8k clusters
 			 * fs size >   16G: 16k clusters
 			 */
-			sect_per_clust = volume_size_bytes >= ((off_t)16)*1024*1024*1024 ? 32 :
-					volume_size_bytes >= ((off_t)8)*1024*1024*1024 ? 16 :
-					volume_size_bytes >=        260*1024*1024 ? 8 : 1;
+			sect_per_clust = 1;
+			if (volume_size_bytes >= 260*1024*1024) {
+				sect_per_clust = 8;
+				/* fight gcc: */
+				/* "error: integer overflow in expression" */
+				/* "error: right shift count >= width of type" */
+				if (sizeof(off_t) > 4) {
+					unsigned t = (volume_size_bytes >> 31 >> 1);
+					if (t >= 8/4)
+						sect_per_clust = 16;
+					if (t >= 16/4)
+						sect_per_clust = 32;
+				}
+			}
 		} else {
 			// floppy, loop, or regular file
 			int not_floppy = ioctl(dev, FDGETPRM, &param);



More information about the busybox-cvs mailing list