apply accumulated post-1.6.1 patches, and bump version to 1.6.2 1_6_stable 1_6_2
authorDenis Vlasenko <vda.linux@googlemail.com>
Mon, 26 Nov 2007 07:17:52 +0000 (07:17 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Mon, 26 Nov 2007 07:17:52 +0000 (07:17 -0000)
Makefile
coreutils/date.c
init/init.c
loginutils/adduser.c

index 8718ebb5220ea608b95877b741aa1dd64ad3c7b9..9719bb4d006b1f2d1dd4e9fafc3d6ddd404c9574 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 6
-SUBLEVEL = 1
+SUBLEVEL = 2
 EXTRAVERSION =
 NAME = Unnamed
 
index 57c826a3f31f67320b2426a65994d0e82e4e67af..9288699a534d2d7d4a70c0c053297529696f4bf1 100644 (file)
 #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);
index cb83b088d4ee708b6f92b871865ae77c81a71215..e3b5dc0921b0b8e2c77d4a3e6ac4e9f272071ef3 100644 (file)
@@ -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");
index 82a4381ad6b5187000aa302b3efcb5648e3d0e01..ee01fc9ac347f5a23ae7ea23aef240384ce8c623 100644 (file)
@@ -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,