summaryrefslogtreecommitdiff
path: root/loginutils/sulogin.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-01-31 17:57:48 +0000
committerBernhard Reutner-Fischer2006-01-31 17:57:48 +0000
commit3038557649ae04860213ab264ff0f647103e5083 (patch)
tree129ac6598e5dc72b75062249ce7b78725c85c388 /loginutils/sulogin.c
parent87be316149604ca18613acb1a776ea4ea9f07929 (diff)
downloadbusybox-3038557649ae04860213ab264ff0f647103e5083.zip
busybox-3038557649ae04860213ab264ff0f647103e5083.tar.gz
- bzero -> memset
text data bss dec hex filename 1652855 14444 1215616 2882915 2bfd63 busybox.oorig.gcc-3.3 1652823 14444 1215616 2882883 2bfd43 busybox.gcc-3.3 1603655 14412 1215552 2833619 2b3cd3 busybox.oorig.gcc-3.4 1603655 14412 1215552 2833619 2b3cd3 busybox.gcc-3.4 1609755 14508 1215744 2840007 2b55c7 busybox.oorig.gcc-4.0 1609755 14508 1215744 2840007 2b55c7 busybox.gcc-4.0 1590495 13516 1215392 2819403 2b054b busybox.oorig.gcc-4.1-HEAD 1590495 13516 1215392 2819403 2b054b busybox.gcc-4.1-HEAD 1589079 13036 1213248 2815363 2af583 busybox.oorig.gcc-4.2-HEAD 1589079 13036 1213248 2815363 2af583 busybox.gcc-4.2-HEAD
Diffstat (limited to 'loginutils/sulogin.c')
-rw-r--r--loginutils/sulogin.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 4346832..cecfa90 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -17,7 +17,6 @@
#include "busybox.h"
-// sulogin defines
#define SULOGIN_PROMPT "\nGive root password for system maintenance\n" \
"(or type Control-D for normal startup):"
@@ -41,7 +40,7 @@ static const char * const forbid[] = {
-static void catchalarm(int junk)
+static void catchalarm(int ATTRIBUTE_UNUSED junk)
{
exit(EXIT_FAILURE);
}
@@ -59,9 +58,9 @@ extern int sulogin_main(int argc, char **argv)
struct passwd pwent;
struct passwd *pwd;
const char * const *p;
-#ifdef CONFIG_FEATURE_SHADOWPASSWDS
+#if ENABLE_FEATURE_SHADOWPASSWDS
struct spwd *spwd = NULL;
-#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
+#endif
openlog("sulogin", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH);
if (argc > 1) {
@@ -114,7 +113,7 @@ extern int sulogin_main(int argc, char **argv)
bb_error_msg_and_die("No password entry for `root'\n");
}
pwent = *pwd;
-#ifdef CONFIG_FEATURE_SHADOWPASSWDS
+#if ENABLE_FEATURE_SHADOWPASSWDS
spwd = NULL;
if (pwd && ((strcmp(pwd->pw_passwd, "x") == 0)
|| (strcmp(pwd->pw_passwd, "*") == 0))) {
@@ -124,7 +123,7 @@ extern int sulogin_main(int argc, char **argv)
pwent.pw_passwd = spwd->sp_pwdp;
}
}
-#endif /* CONFIG_FEATURE_SHADOWPASSWDS */
+#endif
while (1) {
cp = bb_askpass(timeout, SULOGIN_PROMPT);
if (!cp || !*cp) {
@@ -134,7 +133,7 @@ extern int sulogin_main(int argc, char **argv)
exit(EXIT_SUCCESS);
} else {
safe_strncpy(pass, cp, sizeof(pass));
- bzero(cp, strlen(cp));
+ memset(cp, 0, strlen(cp));
}
if (strcmp(pw_encrypt(pass, pwent.pw_passwd), pwent.pw_passwd) == 0) {
break;
@@ -144,13 +143,13 @@ extern int sulogin_main(int argc, char **argv)
fflush(stdout);
syslog(LOG_WARNING, "Incorrect root password\n");
}
- bzero(pass, strlen(pass));
+ memset(pass, 0, strlen(pass));
signal(SIGALRM, SIG_DFL);
puts("Entering System Maintenance Mode\n");
fflush(stdout);
syslog(LOG_INFO, "System Maintenance Mode\n");
-#ifdef CONFIG_SELINUX
+#if ENABLE_SELINUX
renew_current_security_context();
#endif