summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-11-26 07:17:52 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-11-26 07:17:52 +0000
commita0ec7918f3da09156c3897fa63518e16af11081a (patch)
tree9b718211f1dcd71ac51ea95e1a541694f348935b
parent52c886144fd0491fd3b60f04a9f144cac6c12de4 (diff)
downloadbusybox-1_6_stable.tar.gz
apply accumulated post-1.6.1 patches, and bump version to 1.6.21_6_21_6_stable
-rw-r--r--Makefile2
-rw-r--r--coreutils/date.c8
-rw-r--r--init/init.c3
-rw-r--r--loginutils/adduser.c10
4 files changed, 10 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 8718ebb52..9719bb4d0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 6
-SUBLEVEL = 1
+SUBLEVEL = 2
EXTRAVERSION =
NAME = Unnamed
diff --git a/coreutils/date.c b/coreutils/date.c
index 57c826a3f..9288699a5 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -32,16 +32,10 @@
#define DATE_OPT_TIMESPEC 0x20
#define DATE_OPT_HINT 0x40
-static void xputenv(char *s)
-{
- if (putenv(s) != 0)
- bb_error_msg_and_die(bb_msg_memory_exhausted);
-}
-
static void maybe_set_utc(int opt)
{
if (opt & DATE_OPT_UTC)
- xputenv((char*)"TZ=UTC0");
+ putenv((char*)"TZ=UTC0");
}
int date_main(int argc, char **argv);
diff --git a/init/init.c b/init/init.c
index cb83b088d..e3b5dc092 100644
--- a/init/init.c
+++ b/init/init.c
@@ -277,6 +277,9 @@ static void console_init(void)
while (fd > 2) close(fd--);
}
messageD(L_LOG, "console='%s'", s);
+ } else {
+ /* Make sure fd 0,1,2 are not closed */
+ bb_sanitize_stdio();
}
s = getenv("TERM");
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 82a4381ad..ee01fc9ac 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -109,8 +109,9 @@ static int adduser(struct passwd *p)
if (putpwent(p, file) == -1) {
bb_perror_nomsg_and_die();
}
- if (ENABLE_FEATURE_CLEAN_UP)
- fclose(file);
+ /* Do fclose even if !ENABLE_FEATURE_CLEAN_UP.
+ * We will exec passwd, files must be flushed & closed before that! */
+ fclose(file);
#if ENABLE_FEATURE_SHADOWPASSWDS
/* add to shadow if necessary */
@@ -123,8 +124,7 @@ static int adduser(struct passwd *p)
0, /* sp->sp_min */
99999, /* sp->sp_max */
7); /* sp->sp_warn */
- if (ENABLE_FEATURE_CLEAN_UP)
- fclose(file);
+ fclose(file);
}
#endif
@@ -134,7 +134,7 @@ static int adduser(struct passwd *p)
if (addgroup) addgroup_wrapper(p);
/* Clear the umask for this process so it doesn't
- * * screw up the permissions on the mkdir and chown. */
+ * screw up the permissions on the mkdir and chown. */
umask(0);
if (!(option_mask32 & OPT_DONT_MAKE_HOME)) {
/* Set the owner and group so it is owned by the new user,