summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
1VERSION = 1 1VERSION = 1
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 1 3SUBLEVEL = 2
4EXTRAVERSION = 4EXTRAVERSION =
5NAME = Unnamed 5NAME = Unnamed
6 6
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 @@
32#define DATE_OPT_TIMESPEC 0x20 32#define DATE_OPT_TIMESPEC 0x20
33#define DATE_OPT_HINT 0x40 33#define DATE_OPT_HINT 0x40
34 34
35static void xputenv(char *s)
36{
37 if (putenv(s) != 0)
38 bb_error_msg_and_die(bb_msg_memory_exhausted);
39}
40
41static void maybe_set_utc(int opt) 35static void maybe_set_utc(int opt)
42{ 36{
43 if (opt & DATE_OPT_UTC) 37 if (opt & DATE_OPT_UTC)
44 xputenv((char*)"TZ=UTC0"); 38 putenv((char*)"TZ=UTC0");
45} 39}
46 40
47int date_main(int argc, char **argv); 41int 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)
277 while (fd > 2) close(fd--); 277 while (fd > 2) close(fd--);
278 } 278 }
279 messageD(L_LOG, "console='%s'", s); 279 messageD(L_LOG, "console='%s'", s);
280 } else {
281 /* Make sure fd 0,1,2 are not closed */
282 bb_sanitize_stdio();
280 } 283 }
281 284
282 s = getenv("TERM"); 285 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)
109 if (putpwent(p, file) == -1) { 109 if (putpwent(p, file) == -1) {
110 bb_perror_nomsg_and_die(); 110 bb_perror_nomsg_and_die();
111 } 111 }
112 if (ENABLE_FEATURE_CLEAN_UP) 112 /* Do fclose even if !ENABLE_FEATURE_CLEAN_UP.
113 fclose(file); 113 * We will exec passwd, files must be flushed & closed before that! */
114 fclose(file);
114 115
115#if ENABLE_FEATURE_SHADOWPASSWDS 116#if ENABLE_FEATURE_SHADOWPASSWDS
116 /* add to shadow if necessary */ 117 /* add to shadow if necessary */
@@ -123,8 +124,7 @@ static int adduser(struct passwd *p)
123 0, /* sp->sp_min */ 124 0, /* sp->sp_min */
124 99999, /* sp->sp_max */ 125 99999, /* sp->sp_max */
125 7); /* sp->sp_warn */ 126 7); /* sp->sp_warn */
126 if (ENABLE_FEATURE_CLEAN_UP) 127 fclose(file);
127 fclose(file);
128 } 128 }
129#endif 129#endif
130 130
@@ -134,7 +134,7 @@ static int adduser(struct passwd *p)
134 if (addgroup) addgroup_wrapper(p); 134 if (addgroup) addgroup_wrapper(p);
135 135
136 /* Clear the umask for this process so it doesn't 136 /* Clear the umask for this process so it doesn't
137 * * screw up the permissions on the mkdir and chown. */ 137 * screw up the permissions on the mkdir and chown. */
138 umask(0); 138 umask(0);
139 if (!(option_mask32 & OPT_DONT_MAKE_HOME)) { 139 if (!(option_mask32 & OPT_DONT_MAKE_HOME)) {
140 /* Set the owner and group so it is owned by the new user, 140 /* Set the owner and group so it is owned by the new user,