{
int status_want, status_state ;
if (status_hashtable[status_num] == NULL || status_hashtable[status_num]->status == 0)
- return "is not installed or flagged to be installed\n";
+ return "is not installed or flagged to be installed";
status_want = get_status(status_num, 1);
status_state = get_status(status_num, 3);
extern const char bb_path_wtmp_file[];
extern const char bb_dev_null[];
extern const char bb_busybox_exec_path[];
+/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
+ * but I want to save a few bytes here */
+extern const char bb_default_root_login_path[]; /* "/sbin:/usr/sbin:/bin:/usr/bin" */
+#define bb_default_login_path (bb_default_root_login_path + sizeof("/sbin:/usr/sbin"))
extern const int const_int_0;
extern const int const_int_1;
const char bb_dev_null[] = "/dev/null";
const char bb_busybox_exec_path[] = CONFIG_BUSYBOX_EXEC_PATH;
const char bb_default_login_shell[] = LIBBB_DEFAULT_LOGIN_SHELL;
+/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
+ * but I want to save a few bytes here. Check libbb.h before changing! */
+const char bb_default_root_login_path[] = "/sbin:/usr/sbin:/bin:/usr/bin";
+
const int const_int_0;
const int const_int_1 = 1;
#include "libbb.h"
-/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
- * but I want to save a few bytes here */
-static const char DEFAULT_ROOT_LOGIN_PATH[] = "/sbin:/usr/sbin:/bin:/usr/bin";
-#define DEFAULT_LOGIN_PATH (DEFAULT_ROOT_LOGIN_PATH + sizeof("/sbin:/usr/sbin"))
-
void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw)
{
if (loginshell) {
xsetenv("SHELL", shell);
xsetenv("USER", pw->pw_name);
xsetenv("LOGNAME", pw->pw_name);
- xsetenv("PATH", (pw->pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH));
+ xsetenv("PATH", (pw->pw_uid ? bb_default_login_path : bb_default_root_login_path));
}
else if (changeenv) {
/* Set HOME, SHELL, and if not becoming a super-user,
}
if (strncmp(uts_info.release, m_strversion, STRVERSIONLEN) != 0) {
- if (flag_force_load) {
- bb_error_msg("warning: kernel-module version mismatch\n"
- "\t%s was compiled for kernel version %s\n"
- "\twhile this kernel is version %s",
- m_filename, m_strversion, uts_info.release);
- } else {
- bb_error_msg("kernel-module version mismatch\n"
- "\t%s was compiled for kernel version %s\n"
- "\twhile this kernel is version %s.",
- m_filename, m_strversion, uts_info.release);
+ bb_error_msg("%skernel-module version mismatch\n"
+ "\t%s was compiled for kernel version %s\n"
+ "\twhile this kernel is version %s",
+ flag_force_load ? "warning: " : "",
+ m_filename, m_strversion, uts_info.release);
+ if (!flag_force_load)
goto out;
- }
}
}
k_crcs = 0;
if (path->value == null) {
/* Can be merged with same string elsewhere in bbox */
if (geteuid() == 0)
- setval(path, "/sbin:/usr/sbin:/bin:/usr/bin");
+ setval(path, bb_default_root_login_path);
else
- setval(path, "/sbin:/usr/sbin:/bin:/usr/bin" + sizeof("/sbin:/usr/sbin"));
+ setval(path, bb_default_login_path);
}
export(path);