[BusyBox] New patches

David Douthitt ssrat at mailbag.com
Tue Mar 27 20:46:02 UTC 2001


I've modified my two patches slightly.

One (ls.c-fix.patch) is for the problem with file sizes; it would
appear that one version I have modified the BLOCKS and not the size in
bytes.  The new patch works with file sizes only, not file blocks.

The other (ls.c-Aopt.patch) is the same as before but now contains a
modification to Config.h to make it an optional feature.  The idea is
that when logged in as root, "-A" is automatically assumed for ls -
allowing root to see all those files that some hacker's trying to
hide.

It uses the BB_FEATURE_LS_AUTO_AOPT variable to pull the feature in or
not, as the user chooses.  I still make the pitch that its better for
security, but if you don't want it, you don't have to have it.
-------------- next part --------------
--- busybox-0.50/Config.h	Thu Mar 15 12:58:06 2001
+++ busybox-0.50.new/Config.h	Tue Mar 27 13:46:29 2001
@@ -180,6 +180,9 @@
 // enable ls -L
 #define BB_FEATURE_LS_FOLLOWLINKS
 //
+// enable automatic ls -A for root login
+#define BB_FEATURE_LS_AUTO_AOPT
+//
 // Change ping implementation -- simplified, featureless, but really small.
 //#define BB_FEATURE_SIMPLE_PING
 //
--- busybox-0.50/ls.c	Fri Mar  9 15:24:12 2001
+++ busybox-0.50.new/ls.c	Tue Mar 27 13:48:29 2001
@@ -836,6 +836,15 @@
 		}
 	}
 
+#ifdef BB_FEATURE_LS_AUTO_AOPT
+	if ((geteuid()) == 0) {
+
+		/* equivalent to '-A' option automatically set for root */
+
+		disp_opts |= DISP_HIDDEN;
+	}
+#endif
+
 	/* sort out which command line options take precedence */
 #ifdef BB_FEATURE_LS_RECURSIVE
 	if (disp_opts & DISP_NOLIST)
-------------- next part --------------
--- busybox-0.50/ls.c	Fri Mar  9 15:24:12 2001
+++ busybox-0.50.new/ls.c	Tue Mar 27 14:37:40 2001
@@ -652,9 +652,9 @@
 								(ls_disp_hr==TRUE)? 0: 1));
 #else
 #if _FILE_OFFSET_BITS == 64
-					printf("%9lld ", dn->dstat.st_size>>1);
+					printf("%9lld ", dn->dstat.st_size);
 #else
-					printf("%9ld ", dn->dstat.st_size>>1);
+					printf("%9ld ", dn->dstat.st_size);
 #endif
 #endif
 				}


More information about the busybox mailing list