svn commit: trunk/busybox: archival/libunarchive editors findutils etc...

vda at busybox.net vda at busybox.net
Tue Dec 26 18:17:44 UTC 2006


Author: vda
Date: 2006-12-26 10:17:42 -0800 (Tue, 26 Dec 2006)
New Revision: 17084

Log:
merge post-1.3.0 fixes


Modified:
   trunk/busybox/archival/libunarchive/get_header_ar.c
   trunk/busybox/archival/libunarchive/get_header_tar.c
   trunk/busybox/editors/sed.c
   trunk/busybox/findutils/find.c
   trunk/busybox/include/libbb.h
   trunk/busybox/libbb/Kbuild
   trunk/busybox/libbb/bb_strtonum.c
   trunk/busybox/libbb/perror_nomsg.c
   trunk/busybox/libbb/perror_nomsg_and_die.c
   trunk/busybox/networking/udhcp/dhcprelay.c
   trunk/busybox/shell/ash.c
   trunk/busybox/util-linux/mount.c


Changeset:
Modified: trunk/busybox/archival/libunarchive/get_header_ar.c
===================================================================
--- trunk/busybox/archival/libunarchive/get_header_ar.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/archival/libunarchive/get_header_ar.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -9,6 +9,7 @@
 
 char get_header_ar(archive_handle_t *archive_handle)
 {
+	int err;
 	file_header_t *typed = archive_handle->file_header;
 	union {
 		char raw[60];
@@ -45,15 +46,23 @@
 	archive_handle->offset += 60;
 
 	/* align the headers based on the header magic */
-	if ((ar.formatted.magic[0] != '`') || (ar.formatted.magic[1] != '\n')) {
+	if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n')
 		bb_error_msg_and_die("invalid ar header");
-	}
 
-	typed->mode = xstrtoul(ar.formatted.mode, 8);
-	typed->mtime = xatou(ar.formatted.date);
-	typed->uid = xatou(ar.formatted.uid);
-	typed->gid = xatou(ar.formatted.gid);
-	typed->size = xatoul(ar.formatted.size);
+	/* FIXME: more thorough routine would be in order here */
+	/* (we have something like that in tar) */
+	/* but for now we are lax. This code works because */
+	/* on misformatted numbers bb_strtou returns all-ones */
+	typed->mode = err = bb_strtou(ar.formatted.mode, NULL, 8);
+	if (err == -1) bb_error_msg_and_die("invalid ar header");
+	typed->mtime = err = bb_strtou(ar.formatted.date, NULL, 10);
+	if (err == -1) bb_error_msg_and_die("invalid ar header");
+	typed->uid = err = bb_strtou(ar.formatted.uid, NULL, 10);
+	if (err == -1) bb_error_msg_and_die("invalid ar header");
+	typed->gid = err = bb_strtou(ar.formatted.gid, NULL, 10);
+	if (err == -1) bb_error_msg_and_die("invalid ar header");
+	typed->size = err = bb_strtou(ar.formatted.size, NULL, 10);
+	if (err == -1) bb_error_msg_and_die("invalid ar header");
 
 	/* long filenames have '/' as the first character */
 	if (ar.formatted.name[0] == '/') {

Modified: trunk/busybox/archival/libunarchive/get_header_tar.c
===================================================================
--- trunk/busybox/archival/libunarchive/get_header_tar.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/archival/libunarchive/get_header_tar.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -74,8 +74,10 @@
 
 	if (sizeof(tar) != 512)
 		BUG_tar_header_size();
+
+#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
  again:
-
+#endif
 	/* Align header */
 	data_align(archive_handle, 512);
 

Modified: trunk/busybox/editors/sed.c
===================================================================
--- trunk/busybox/editors/sed.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/editors/sed.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -120,7 +120,6 @@
 } bbg;
 
 
-void sed_free_and_close_stuff(void);
 #if ENABLE_FEATURE_CLEAN_UP
 static void sed_free_and_close_stuff(void)
 {
@@ -156,6 +155,8 @@
 	while (bbg.current_input_file < bbg.input_file_count)
 		fclose(bbg.input_file_list[bbg.current_input_file++]);
 }
+#else
+void sed_free_and_close_stuff(void);
 #endif
 
 /* If something bad happens during -i operation, delete temp file */

Modified: trunk/busybox/findutils/find.c
===================================================================
--- trunk/busybox/findutils/find.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/findutils/find.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -76,6 +76,7 @@
 static int need_print = 1;
 
 
+#if ENABLE_FEATURE_FIND_EXEC
 static int count_subst(const char *str)
 {
 	int count = 0;
@@ -103,6 +104,7 @@
 	strcpy(dst, src);
 	return buf;
 }
+#endif
 
 
 static int exec_actions(action ***appp, const char *fileName, struct stat *statbuf)
@@ -556,8 +558,8 @@
 			argp[0] = "-a";
 		}
 		argp++;
+#endif
 	}
-#endif
 
 	actions = parse_params(&argv[firstopt]);
 

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/include/libbb.h	2006-12-26 18:17:42 UTC (rev 17084)
@@ -51,7 +51,9 @@
 
 #include "pwd_.h"
 #include "grp_.h"
+#if ENABLE_FEATURE_SHADOWPASSWDS
 #include "shadow_.h"
+#endif
 
 /* Try to pull in PATH_MAX */
 #include <limits.h>

Modified: trunk/busybox/libbb/Kbuild
===================================================================
--- trunk/busybox/libbb/Kbuild	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/libbb/Kbuild	2006-12-26 18:17:42 UTC (rev 17084)
@@ -113,5 +113,6 @@
 
 lib-$(CONFIG_AWK) += xregcomp.o
 lib-$(CONFIG_SED) += xregcomp.o
-lib-$(CONFIG_LESS) += xregcomp.o
+lib-$(CONFIG_GREP) += xregcomp.o
+lib-$(CONFIG_MDEV) += xregcomp.o
 lib-$(CONFIG_DEVFSD) += xregcomp.o

Modified: trunk/busybox/libbb/bb_strtonum.c
===================================================================
--- trunk/busybox/libbb/bb_strtonum.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/libbb/bb_strtonum.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -17,6 +17,7 @@
  * errno = ERANGE if value had alphanumeric terminating char ("1234abcg").
  * errno = ERANGE if value is out of range, missing, etc.
  * errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok )
+ *    return value is all-ones in this case.
  */
 
 static unsigned long long ret_ERANGE(void)

Modified: trunk/busybox/libbb/perror_nomsg.c
===================================================================
--- trunk/busybox/libbb/perror_nomsg.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/libbb/perror_nomsg.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -7,10 +7,13 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-#include "libbb.h"
+/* gcc warns about a null format string, therefore we provide
+ * modified definition without "attribute (format)"
+ * instead of including libbb.h */
+//#include "libbb.h"
+extern void bb_perror_msg(const char *s, ...);
 
 void bb_perror_nomsg(void)
 {
-	/* Ignore the gcc warning about a null format string. */
-	bb_perror_msg(NULL);
+	bb_perror_msg(0);
 }

Modified: trunk/busybox/libbb/perror_nomsg_and_die.c
===================================================================
--- trunk/busybox/libbb/perror_nomsg_and_die.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/libbb/perror_nomsg_and_die.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -7,11 +7,13 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-#include <stddef.h>
-#include "libbb.h"
+/* gcc warns about a null format string, therefore we provide
+ * modified definition without "attribute (format)"
+ * instead of including libbb.h */
+//#include "libbb.h"
+extern void bb_perror_msg_and_die(const char *s, ...);
 
 void bb_perror_nomsg_and_die(void)
 {
-	/* Ignore the gcc warning about a null format string. */
-	bb_perror_msg_and_die(NULL);
+	bb_perror_msg_and_die(0);
 }

Modified: trunk/busybox/networking/udhcp/dhcprelay.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcprelay.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/networking/udhcp/dhcprelay.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -257,7 +257,8 @@
 {
 	struct dhcpMessage dhcp_msg;
 	fd_set rfds;
-	size_t packlen, addr_size;
+	size_t packlen;
+	socklen_t addr_size;
 	struct sockaddr_in client_addr;
 	struct timeval tv;
 	int i;

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/shell/ash.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -85,7 +85,7 @@
 #ifdef CONFIG_ASH_JOB_CONTROL
 #define JOBS 1
 #else
-#undef JOBS
+#define JOBS 0
 #endif
 
 #if JOBS || defined(CONFIG_ASH_READ_NCHARS)
@@ -6647,7 +6647,7 @@
 }
 #endif /* JOBS */
 
-#if defined(JOBS) || DEBUG
+#if JOBS || DEBUG
 static int
 jobno(const struct job *jp)
 {

Modified: trunk/busybox/util-linux/mount.c
===================================================================
--- trunk/busybox/util-linux/mount.c	2006-12-26 17:40:33 UTC (rev 17083)
+++ trunk/busybox/util-linux/mount.c	2006-12-26 18:17:42 UTC (rev 17084)
@@ -1708,10 +1708,13 @@
 
 			// Mount this thing.
 
+			// NFS mounts want this to be xrealloc-able
+			mtcur->mnt_opts = xstrdup(mtcur->mnt_opts);
 			if (singlemount(mtcur, 1)) {
 				/* Count number of failed mounts */
 				rc++;
 			}
+			free(mtcur->mnt_opts);
 		}
 	}
 	if (ENABLE_FEATURE_CLEAN_UP) endmntent(fstab);




More information about the busybox-cvs mailing list