svn commit: trunk/busybox: coreutils editors libbb shell

vda at busybox.net vda at busybox.net
Mon Jun 23 22:31:53 UTC 2008


Author: vda
Date: 2008-06-23 15:31:52 -0700 (Mon, 23 Jun 2008)
New Revision: 22483

Log:
fix breakage found by randomconfig



Modified:
   trunk/busybox/Config.in
   trunk/busybox/Makefile
   trunk/busybox/coreutils/ls.c
   trunk/busybox/editors/diff.c
   trunk/busybox/libbb/Kbuild
   trunk/busybox/shell/ash.c
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/Config.in
===================================================================
--- trunk/busybox/Config.in	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/Config.in	2008-06-23 22:31:52 UTC (rev 22483)
@@ -293,10 +293,12 @@
 
 	  Most people will leave this set to 'N'.
 
+# PIE can be made to work with BUILD_LIBBUSYBOX, but currently
+# build system does not support that
 config BUILD_LIBBUSYBOX
 	bool "Build shared libbusybox"
 	default n
-	depends on !FEATURE_PREFER_APPLETS
+	depends on !FEATURE_PREFER_APPLETS && !PIE
 	help
 	  Build a shared library libbusybox.so.N.N.N which contains all
 	  busybox code.

Modified: trunk/busybox/Makefile
===================================================================
--- trunk/busybox/Makefile	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/Makefile	2008-06-23 22:31:52 UTC (rev 22483)
@@ -698,6 +698,8 @@
 else
 	$(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \
 		busybox_unstripped -o $@
+# strip is confused by PIE executable and does not set exec bits
+	$(Q)chmod a+x $@
 endif
 
 # The actual objects are generated when descending,

Modified: trunk/busybox/coreutils/ls.c
===================================================================
--- trunk/busybox/coreutils/ls.c	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/coreutils/ls.c	2008-06-23 22:31:52 UTC (rev 22483)
@@ -171,8 +171,8 @@
 /* memset: we have to zero it out because of NOEXEC */
 #define INIT_G() { \
 	memset(&G, 0, sizeof(G)); \
-	tabstops = COLUMN_GAP; \
-	terminal_width = TERMINAL_WIDTH; \
+	USE_FEATURE_AUTOWIDTH(tabstops = COLUMN_GAP;) \
+	USE_FEATURE_AUTOWIDTH(terminal_width = TERMINAL_WIDTH;) \
 	USE_FEATURE_LS_TIMESTAMPS(time(&current_time_t);) \
 }
 

Modified: trunk/busybox/editors/diff.c
===================================================================
--- trunk/busybox/editors/diff.c	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/editors/diff.c	2008-06-23 22:31:52 UTC (rev 22483)
@@ -161,14 +161,14 @@
 } while (0)
 
 
-/*static void print_only(const char *path, size_t dirlen, const char *entry)*/
+#if ENABLE_FEATURE_DIFF_DIR
 static void print_only(const char *path, const char *entry)
 {
 	printf("Only in %s: %s\n", path, entry);
 }
+#endif
 
 
-/*static void print_status(int val, char *path1, char *path2, char *entry)*/
 static void print_status(int val, char *_path1, char *_path2)
 {
 	/*const char *const _entry = entry ? entry : "";*/

Modified: trunk/busybox/libbb/Kbuild
===================================================================
--- trunk/busybox/libbb/Kbuild	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/libbb/Kbuild	2008-06-23 22:31:52 UTC (rev 22483)
@@ -119,9 +119,9 @@
 lib-$(CONFIG_CRYPTPW) += pw_encrypt.o crypt_make_salt.o
 lib-$(CONFIG_SULOGIN) += pw_encrypt.o
 lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o
-lib-$(CONFIG_VLOCK) += correct_password.o
-lib-$(CONFIG_SU) += correct_password.o
-lib-$(CONFIG_LOGIN) += correct_password.o
+lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o
+lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o
+lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o
 lib-$(CONFIG_DF) += find_mount_point.o
 lib-$(CONFIG_MKFS_MINIX) += find_mount_point.o
 lib-$(CONFIG_SELINUX) += selinux_common.o

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/shell/ash.c	2008-06-23 22:31:52 UTC (rev 22483)
@@ -8983,7 +8983,7 @@
 		}
 	}
 #else
-	nr = nonblock_safe_read(parsefile->fd, buf, BUFSIZ - 1);
+	nr = nonblock_safe_read(g_parsefile->fd, buf, BUFSIZ - 1);
 #endif
 
 #if 0

Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2008-06-23 16:28:53 UTC (rev 22482)
+++ trunk/busybox/shell/hush.c	2008-06-23 22:31:52 UTC (rev 22483)
@@ -399,11 +399,11 @@
 #if ENABLE_FEATURE_EDITING
 	line_input_t *line_input_state;
 #endif
+	pid_t root_pid;
 #if ENABLE_HUSH_JOB
 	int run_list_level;
 	pid_t saved_task_pgrp;
 	pid_t saved_tty_pgrp;
-	pid_t root_pid;
 	int last_jobid;
 	struct pipe *job_list;
 	struct pipe *toplevel_list;
@@ -446,11 +446,11 @@
 #if ENABLE_FEATURE_EDITING
 #define line_input_state (G.line_input_state)
 #endif
+#define root_pid         (G.root_pid        )
 #if ENABLE_HUSH_JOB
 #define run_list_level   (G.run_list_level  )
 #define saved_task_pgrp  (G.saved_task_pgrp )
 #define saved_tty_pgrp   (G.saved_tty_pgrp  )
-#define root_pid         (G.root_pid        )
 #define last_jobid       (G.last_jobid      )
 #define job_list         (G.job_list        )
 #define toplevel_list    (G.toplevel_list   )
@@ -1065,7 +1065,7 @@
 		debug_printf_list("list[%d]=%d string_start=%d (empty slot)\n", n, string_len, string_start);
 		o->has_empty_slot = 0;
 	}
-	list[n] = (char*)string_len;
+	list[n] = (char*)(ptrdiff_t)string_len;
 	return n + 1;
 }
 
@@ -1075,7 +1075,7 @@
 	char **list = (char**)o->data;
 	int string_start = ((n + 0xf) & ~0xf) * sizeof(list[0]);
 
-	return ((int)list[n-1]) + string_start;
+	return ((int)(ptrdiff_t)list[n-1]) + string_start;
 }
 
 /* o_glob performs globbing on last list[], saving each result
@@ -1152,7 +1152,7 @@
 	list[--n] = NULL;
 	while (n) {
 		n--;
-		list[n] = o->data + (int)list[n] + string_start;
+		list[n] = o->data + (int)(ptrdiff_t)list[n] + string_start;
 	}
 	return list;
 }
@@ -2012,6 +2012,7 @@
 #else
 	enum { if_code = 0, next_if_code = 0 };
 #endif
+// TODO: rword and ->res_word are not needed if !LOOPS and !IF
 	reserved_style rword;
 	reserved_style skip_more_for_this_rword = RES_XXXX;
 
@@ -3009,7 +3010,7 @@
 	 * IOW: it is safe to do it unconditionally.
 	 * RES_IN case is for "for a in; do ..." (empty IN set)
 	 * to work. */
-	if (not_null || ctx->pipe->res_word == RES_IN) {
+	if (not_null USE_HUSH_LOOPS(|| ctx->pipe->res_word == RES_IN)) {
 		struct pipe *new_p = new_pipe();
 		ctx->pipe->next = new_p;
 		ctx->pipe = new_p;




More information about the busybox-cvs mailing list