summaryrefslogtreecommitdiffstats
path: root/login-utils/su.c
diff options
context:
space:
mode:
authorJim Meyering2004-06-01 15:04:02 +0200
committerJim Meyering2004-06-01 15:04:02 +0200
commit179a9823781870d9193e77558a2c6e843971fcae (patch)
tree2e99d735b7631400a404481d938d015e9f4eedb2 /login-utils/su.c
parent(usage): Use EXIT_SUCCESS, not 0, for clarity. (diff)
downloadkernel-qcow2-util-linux-179a9823781870d9193e77558a2c6e843971fcae.tar.gz
kernel-qcow2-util-linux-179a9823781870d9193e77558a2c6e843971fcae.tar.xz
kernel-qcow2-util-linux-179a9823781870d9193e77558a2c6e843971fcae.zip
(correct_password, restricted_shell, main):
Prefer the notation `STREQ (a, b)' over `strcmp (a, b) == 0'.
Diffstat (limited to 'login-utils/su.c')
-rw-r--r--login-utils/su.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/login-utils/su.c b/login-utils/su.c
index d15d96a93..b91b8d379 100644
--- a/login-utils/su.c
+++ b/login-utils/su.c
@@ -293,7 +293,7 @@ correct_password (const struct passwd *pw)
}
encrypted = crypt (unencrypted, correct);
memset (unencrypted, 0, strlen (unencrypted));
- return strcmp (encrypted, correct) == 0;
+ return STREQ (encrypted, correct);
}
/* Update `environ' for the new shell based on PW, with SHELL being
@@ -415,7 +415,7 @@ restricted_shell (const char *shell)
setusershell ();
while ((line = getusershell ()) != NULL)
{
- if (*line != '#' && strcmp (line, shell) == 0)
+ if (*line != '#' && STREQ (line, shell))
{
endusershell ();
return 0;
@@ -516,7 +516,7 @@ main (int argc, char **argv)
}
}
- if (optind < argc && !strcmp (argv[optind], "-"))
+ if (optind < argc && STREQ (argv[optind], "-"))
{
simulate_login = 1;
++optind;