Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/setup_environment.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/libbb/setup_environment.c
r2725 r3232 33 33 void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw) 34 34 { 35 if (!shell || !shell[0]) 36 shell = DEFAULT_SHELL; 37 35 38 /* Change the current working directory to be the home directory 36 39 * of the user */ 37 if (chdir(pw->pw_dir)) { 38 xchdir((flags & SETUP_ENV_TO_TMP) ? "/tmp" : "/"); 39 bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir); 40 if (!(flags & SETUP_ENV_NO_CHDIR)) { 41 if (chdir(pw->pw_dir) != 0) { 42 bb_error_msg("can't change directory to '%s'", pw->pw_dir); 43 xchdir((flags & SETUP_ENV_TO_TMP) ? "/tmp" : "/"); 44 } 40 45 } 41 46
Note:
See TracChangeset
for help on using the changeset viewer.