summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorKarel Zak2007-03-06 13:45:59 +0100
committerKarel Zak2007-03-07 10:14:03 +0100
commit7ab59baf58c317662afaa3ae83537ccd4c4aea65 (patch)
treeb37af76eb973e21204da06b84ad22d3f60a44f50 /login-utils
parentlook: remove tailing white-spaces (diff)
downloadkernel-qcow2-util-linux-7ab59baf58c317662afaa3ae83537ccd4c4aea65.tar.gz
kernel-qcow2-util-linux-7ab59baf58c317662afaa3ae83537ccd4c4aea65.tar.xz
kernel-qcow2-util-linux-7ab59baf58c317662afaa3ae83537ccd4c4aea65.zip
chsh: remove tailing wihit-spaces and use PATH_BSHELL
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/chsh.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index 8bd2d0bda..add7c4395 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -41,6 +41,7 @@
#include "setpwnam.h"
#include "nls.h"
#include "env.h"
+#include "pathnames.h"
#if defined(REQUIRE_PASSWORD) && defined(HAVE_SECURITY_PAM_MISC_H)
#include <security/pam_appl.h>
@@ -149,7 +150,7 @@ main (int argc, char *argv[]) {
#endif
oldshell = pw->pw_shell;
- if (!oldshell[0]) oldshell = "/bin/sh";
+ if (!oldshell[0]) oldshell = _PATH_BSHELL;
/* reality check */
if (uid != 0 && uid != pw->pw_uid) {
@@ -164,7 +165,7 @@ main (int argc, char *argv[]) {
" denied\n"),whoami);
return (-1);
}
-
+
shell = info.shell;
printf( _("Changing shell for %s.\n"), pw->pw_name );
@@ -211,14 +212,14 @@ main (int argc, char *argv[]) {
shell = prompt (_("New shell"), oldshell);
if (! shell) return 0;
}
-
+
if (check_shell (shell) < 0) return (-1);
if (! strcmp (pw->pw_shell, shell)) {
printf (_("Shell not changed.\n"));
return 0;
}
- if (!strcmp(shell, "/bin/sh")) shell = "";
+ if (!strcmp(shell, _PATH_BSHELL)) shell = "";
pw->pw_shell = shell;
if (setpwnam (pw) < 0) {
perror ("setpwnam");
@@ -303,7 +304,7 @@ static char *
prompt (char *question, char *def_val) {
int len;
char *ans, *cp;
-
+
if (! def_val) def_val = "";
printf("%s [%s]: ", question, def_val);
*buf = 0;