Simply use eprintf() instead of enprintf()

This commit is contained in:
sin 2014-02-27 14:57:22 +00:00
parent e75c56ad6a
commit 634e77a1a5

10
su.c
View File

@ -58,16 +58,16 @@ main(int argc, char **argv)
if (errno) if (errno)
eprintf("getspnam: %s:", usr); eprintf("getspnam: %s:", usr);
else if (!spw) else if (!spw)
enprintf(EXIT_FAILURE, "who are you?\n"); eprintf("who are you?\n");
switch (spw->sp_pwdp[0]) { switch (spw->sp_pwdp[0]) {
case '!': case '!':
case '*': case '*':
enprintf(EXIT_FAILURE, "Denied\n"); eprintf("Denied\n");
case '$': case '$':
break; break;
default: default:
enprintf(EXIT_FAILURE, "Invalid shadow record\n"); eprintf("Invalid shadow record\n");
} }
uid = getuid(); uid = getuid();
@ -83,7 +83,7 @@ main(int argc, char **argv)
eprintf("crypt:"); eprintf("crypt:");
if (strcmp(cryptpass, spw->sp_pwdp) != 0) if (strcmp(cryptpass, spw->sp_pwdp) != 0)
enprintf(EXIT_FAILURE, "Denied\n"); eprintf("Denied\n");
} }
errno = 0; errno = 0;
@ -91,7 +91,7 @@ main(int argc, char **argv)
if (errno) if (errno)
eprintf("getpwnam: %s", usr); eprintf("getpwnam: %s", usr);
else if (!pw) else if (!pw)
enprintf(EXIT_FAILURE, "who are you?\n"); eprintf("who are you?\n");
if (initgroups(usr, pw->pw_gid) < 0) if (initgroups(usr, pw->pw_gid) < 0)
eprintf("initgroups:"); eprintf("initgroups:");