aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-26 18:17:42 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-26 18:17:42 +0000
commitd507f94cf4aad6f3f03f478fcba27ec673d8e1d6 (patch)
treec23e6a01fc51d8419c1562f70836148c705ac46a
parent814481658de0435847aa696c3d748871f1c72122 (diff)
downloadbusybox-w32-d507f94cf4aad6f3f03f478fcba27ec673d8e1d6.tar.gz
busybox-w32-d507f94cf4aad6f3f03f478fcba27ec673d8e1d6.tar.bz2
busybox-w32-d507f94cf4aad6f3f03f478fcba27ec673d8e1d6.zip
merge post-1.3.0 fixes
git-svn-id: svn://busybox.net/trunk/busybox@17084 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--archival/libunarchive/get_header_ar.c23
-rw-r--r--archival/libunarchive/get_header_tar.c4
-rw-r--r--editors/sed.c3
-rw-r--r--findutils/find.c4
-rw-r--r--include/libbb.h2
-rw-r--r--libbb/Kbuild3
-rw-r--r--libbb/bb_strtonum.c1
-rw-r--r--libbb/perror_nomsg.c9
-rw-r--r--libbb/perror_nomsg_and_die.c10
-rw-r--r--networking/udhcp/dhcprelay.c3
-rw-r--r--shell/ash.c4
-rw-r--r--util-linux/mount.c3
12 files changed, 48 insertions, 21 deletions
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c
index 6638c65aa..4e294b2c0 100644
--- a/archival/libunarchive/get_header_ar.c
+++ b/archival/libunarchive/get_header_ar.c
@@ -9,6 +9,7 @@
9 9
10char get_header_ar(archive_handle_t *archive_handle) 10char get_header_ar(archive_handle_t *archive_handle)
11{ 11{
12 int err;
12 file_header_t *typed = archive_handle->file_header; 13 file_header_t *typed = archive_handle->file_header;
13 union { 14 union {
14 char raw[60]; 15 char raw[60];
@@ -45,15 +46,23 @@ char get_header_ar(archive_handle_t *archive_handle)
45 archive_handle->offset += 60; 46 archive_handle->offset += 60;
46 47
47 /* align the headers based on the header magic */ 48 /* align the headers based on the header magic */
48 if ((ar.formatted.magic[0] != '`') || (ar.formatted.magic[1] != '\n')) { 49 if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n')
49 bb_error_msg_and_die("invalid ar header"); 50 bb_error_msg_and_die("invalid ar header");
50 }
51 51
52 typed->mode = xstrtoul(ar.formatted.mode, 8); 52 /* FIXME: more thorough routine would be in order here */
53 typed->mtime = xatou(ar.formatted.date); 53 /* (we have something like that in tar) */
54 typed->uid = xatou(ar.formatted.uid); 54 /* but for now we are lax. This code works because */
55 typed->gid = xatou(ar.formatted.gid); 55 /* on misformatted numbers bb_strtou returns all-ones */
56 typed->size = xatoul(ar.formatted.size); 56 typed->mode = err = bb_strtou(ar.formatted.mode, NULL, 8);
57 if (err == -1) bb_error_msg_and_die("invalid ar header");
58 typed->mtime = err = bb_strtou(ar.formatted.date, NULL, 10);
59 if (err == -1) bb_error_msg_and_die("invalid ar header");
60 typed->uid = err = bb_strtou(ar.formatted.uid, NULL, 10);
61 if (err == -1) bb_error_msg_and_die("invalid ar header");
62 typed->gid = err = bb_strtou(ar.formatted.gid, NULL, 10);
63 if (err == -1) bb_error_msg_and_die("invalid ar header");
64 typed->size = err = bb_strtou(ar.formatted.size, NULL, 10);
65 if (err == -1) bb_error_msg_and_die("invalid ar header");
57 66
58 /* long filenames have '/' as the first character */ 67 /* long filenames have '/' as the first character */
59 if (ar.formatted.name[0] == '/') { 68 if (ar.formatted.name[0] == '/') {
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index beb8687c7..622f09fa5 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -74,8 +74,10 @@ char get_header_tar(archive_handle_t *archive_handle)
74 74
75 if (sizeof(tar) != 512) 75 if (sizeof(tar) != 512)
76 BUG_tar_header_size(); 76 BUG_tar_header_size();
77 again:
78 77
78#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
79 again:
80#endif
79 /* Align header */ 81 /* Align header */
80 data_align(archive_handle, 512); 82 data_align(archive_handle, 512);
81 83
diff --git a/editors/sed.c b/editors/sed.c
index 95ced1ceb..23d73faa9 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -120,7 +120,6 @@ struct sed_globals {
120} bbg; 120} bbg;
121 121
122 122
123void sed_free_and_close_stuff(void);
124#if ENABLE_FEATURE_CLEAN_UP 123#if ENABLE_FEATURE_CLEAN_UP
125static void sed_free_and_close_stuff(void) 124static void sed_free_and_close_stuff(void)
126{ 125{
@@ -156,6 +155,8 @@ static void sed_free_and_close_stuff(void)
156 while (bbg.current_input_file < bbg.input_file_count) 155 while (bbg.current_input_file < bbg.input_file_count)
157 fclose(bbg.input_file_list[bbg.current_input_file++]); 156 fclose(bbg.input_file_list[bbg.current_input_file++]);
158} 157}
158#else
159void sed_free_and_close_stuff(void);
159#endif 160#endif
160 161
161/* If something bad happens during -i operation, delete temp file */ 162/* If something bad happens during -i operation, delete temp file */
diff --git a/findutils/find.c b/findutils/find.c
index fffa3cd5c..2f94d13e7 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -76,6 +76,7 @@ static action ***actions;
76static int need_print = 1; 76static int need_print = 1;
77 77
78 78
79#if ENABLE_FEATURE_FIND_EXEC
79static int count_subst(const char *str) 80static int count_subst(const char *str)
80{ 81{
81 int count = 0; 82 int count = 0;
@@ -103,6 +104,7 @@ static char* subst(const char *src, int count, const char* filename)
103 strcpy(dst, src); 104 strcpy(dst, src);
104 return buf; 105 return buf;
105} 106}
107#endif
106 108
107 109
108static int exec_actions(action ***appp, const char *fileName, struct stat *statbuf) 110static int exec_actions(action ***appp, const char *fileName, struct stat *statbuf)
@@ -556,8 +558,8 @@ int find_main(int argc, char **argv)
556 argp[0] = "-a"; 558 argp[0] = "-a";
557 } 559 }
558 argp++; 560 argp++;
559 }
560#endif 561#endif
562 }
561 563
562 actions = parse_params(&argv[firstopt]); 564 actions = parse_params(&argv[firstopt]);
563 565
diff --git a/include/libbb.h b/include/libbb.h
index 858adca4c..a2b9a82b2 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -51,7 +51,9 @@
51 51
52#include "pwd_.h" 52#include "pwd_.h"
53#include "grp_.h" 53#include "grp_.h"
54#if ENABLE_FEATURE_SHADOWPASSWDS
54#include "shadow_.h" 55#include "shadow_.h"
56#endif
55 57
56/* Try to pull in PATH_MAX */ 58/* Try to pull in PATH_MAX */
57#include <limits.h> 59#include <limits.h>
diff --git a/libbb/Kbuild b/libbb/Kbuild
index c15615302..64e4531ce 100644
--- a/libbb/Kbuild
+++ b/libbb/Kbuild
@@ -113,5 +113,6 @@ lib-$(CONFIG_EJECT) += find_mount_point.o
113 113
114lib-$(CONFIG_AWK) += xregcomp.o 114lib-$(CONFIG_AWK) += xregcomp.o
115lib-$(CONFIG_SED) += xregcomp.o 115lib-$(CONFIG_SED) += xregcomp.o
116lib-$(CONFIG_LESS) += xregcomp.o 116lib-$(CONFIG_GREP) += xregcomp.o
117lib-$(CONFIG_MDEV) += xregcomp.o
117lib-$(CONFIG_DEVFSD) += xregcomp.o 118lib-$(CONFIG_DEVFSD) += xregcomp.o
diff --git a/libbb/bb_strtonum.c b/libbb/bb_strtonum.c
index 6fbd1f87d..50ef0ba26 100644
--- a/libbb/bb_strtonum.c
+++ b/libbb/bb_strtonum.c
@@ -17,6 +17,7 @@
17 * errno = ERANGE if value had alphanumeric terminating char ("1234abcg"). 17 * errno = ERANGE if value had alphanumeric terminating char ("1234abcg").
18 * errno = ERANGE if value is out of range, missing, etc. 18 * errno = ERANGE if value is out of range, missing, etc.
19 * errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok ) 19 * errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok )
20 * return value is all-ones in this case.
20 */ 21 */
21 22
22static unsigned long long ret_ERANGE(void) 23static unsigned long long ret_ERANGE(void)
diff --git a/libbb/perror_nomsg.c b/libbb/perror_nomsg.c
index 3aefd5301..8059f9fd8 100644
--- a/libbb/perror_nomsg.c
+++ b/libbb/perror_nomsg.c
@@ -7,10 +7,13 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include "libbb.h" 10/* gcc warns about a null format string, therefore we provide
11 * modified definition without "attribute (format)"
12 * instead of including libbb.h */
13//#include "libbb.h"
14extern void bb_perror_msg(const char *s, ...);
11 15
12void bb_perror_nomsg(void) 16void bb_perror_nomsg(void)
13{ 17{
14 /* Ignore the gcc warning about a null format string. */ 18 bb_perror_msg(0);
15 bb_perror_msg(NULL);
16} 19}
diff --git a/libbb/perror_nomsg_and_die.c b/libbb/perror_nomsg_and_die.c
index e5623c2a9..c416df67c 100644
--- a/libbb/perror_nomsg_and_die.c
+++ b/libbb/perror_nomsg_and_die.c
@@ -7,11 +7,13 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <stddef.h> 10/* gcc warns about a null format string, therefore we provide
11#include "libbb.h" 11 * modified definition without "attribute (format)"
12 * instead of including libbb.h */
13//#include "libbb.h"
14extern void bb_perror_msg_and_die(const char *s, ...);
12 15
13void bb_perror_nomsg_and_die(void) 16void bb_perror_nomsg_and_die(void)
14{ 17{
15 /* Ignore the gcc warning about a null format string. */ 18 bb_perror_msg_and_die(0);
16 bb_perror_msg_and_die(NULL);
17} 19}
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c
index a3ea327c3..78a1b5e62 100644
--- a/networking/udhcp/dhcprelay.c
+++ b/networking/udhcp/dhcprelay.c
@@ -257,7 +257,8 @@ static void dhcprelay_loop(int *fds, int num_sockets, int max_socket, char **cli
257{ 257{
258 struct dhcpMessage dhcp_msg; 258 struct dhcpMessage dhcp_msg;
259 fd_set rfds; 259 fd_set rfds;
260 size_t packlen, addr_size; 260 size_t packlen;
261 socklen_t addr_size;
261 struct sockaddr_in client_addr; 262 struct sockaddr_in client_addr;
262 struct timeval tv; 263 struct timeval tv;
263 int i; 264 int i;
diff --git a/shell/ash.c b/shell/ash.c
index afb9b6a95..dcf77054f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -85,7 +85,7 @@
85#ifdef CONFIG_ASH_JOB_CONTROL 85#ifdef CONFIG_ASH_JOB_CONTROL
86#define JOBS 1 86#define JOBS 1
87#else 87#else
88#undef JOBS 88#define JOBS 0
89#endif 89#endif
90 90
91#if JOBS || defined(CONFIG_ASH_READ_NCHARS) 91#if JOBS || defined(CONFIG_ASH_READ_NCHARS)
@@ -6647,7 +6647,7 @@ usage:
6647} 6647}
6648#endif /* JOBS */ 6648#endif /* JOBS */
6649 6649
6650#if defined(JOBS) || DEBUG 6650#if JOBS || DEBUG
6651static int 6651static int
6652jobno(const struct job *jp) 6652jobno(const struct job *jp)
6653{ 6653{
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 661e26f19..b3e8c478c 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -1708,10 +1708,13 @@ int mount_main(int argc, char **argv)
1708 1708
1709 // Mount this thing. 1709 // Mount this thing.
1710 1710
1711 // NFS mounts want this to be xrealloc-able
1712 mtcur->mnt_opts = xstrdup(mtcur->mnt_opts);
1711 if (singlemount(mtcur, 1)) { 1713 if (singlemount(mtcur, 1)) {
1712 /* Count number of failed mounts */ 1714 /* Count number of failed mounts */
1713 rc++; 1715 rc++;
1714 } 1716 }
1717 free(mtcur->mnt_opts);
1715 } 1718 }
1716 } 1719 }
1717 if (ENABLE_FEATURE_CLEAN_UP) endmntent(fstab); 1720 if (ENABLE_FEATURE_CLEAN_UP) endmntent(fstab);