#define is_pam_failure(_rc) ((_rc) != PAM_SUCCESS)
-/* The shell to run if none is given in the user's passwd entry. */
-#define DEFAULT_SHELL "/bin/sh"
-
/* The user to become if none is specified. */
#define DEFAULT_USER "root"
su->old_user = xgetlogin();
if (!su->pwd->pw_shell || !*su->pwd->pw_shell)
- su->pwd->pw_shell = DEFAULT_SHELL;
+ su->pwd->pw_shell = _PATH_BSHELL;
if (use_supp && !use_gid)
su->pwd->pw_gid = groups[0];
#include <fcntl.h>
#include <signal.h>
#include <pwd.h>
+#include <paths.h>
#include <shadow.h>
#include <termios.h>
#include <errno.h>
if (pwd->pw_shell[0])
su_shell = pwd->pw_shell;
else
- su_shell = "/bin/sh";
+ su_shell = _PATH_BSHELL;
}
if ((p = strrchr(su_shell, '/')) == NULL)
p = su_shell;
execl(su_shell, shell, (char *)NULL);
warn(_("failed to execute %s"), su_shell);
- xsetenv("SHELL", "/bin/sh", 1);
- execl("/bin/sh", profile ? "-sh" : "sh", (char *)NULL);
- warn(_("failed to execute %s"), "/bin/sh");
+ xsetenv("SHELL", _PATH_BSHELL, 1);
+ execl(_PATH_BSHELL, profile ? "-sh" : "sh", (char *)NULL);
+ warn(_("failed to execute %s"), _PATH_BSHELL);
}
#ifdef HAVE_LIBSELINUX
#include <sys/prctl.h>
#include <sys/types.h>
#include <unistd.h>
+#include <paths.h>
#include "all-io.h"
#include "c.h"
#define SETPRIV_EXIT_PRIVERR 127 /* how we exit when we fail to set privs */
-/* The shell to set SHELL env.variable if none is given in the user's passwd entry. */
-#define DEFAULT_SHELL "/bin/sh"
-
static gid_t get_group(const char *s, const char *err);
enum cap_type {
if (pw->pw_shell && *pw->pw_shell)
xsetenv("SHELL", pw->pw_shell, 1);
else
- xsetenv("SHELL", DEFAULT_SHELL, 1);
+ xsetenv("SHELL", _PATH_BSHELL, 1);
xsetenv("HOME", pw->pw_dir, 1);
xsetenv("USER", pw->pw_name, 1);