summaryrefslogtreecommitdiff
path: root/loginutils/sulogin.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-12 16:56:52 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-12 16:56:52 +0000
commitfdddab0c61c55c25d4218d4370e2b16a7936a794 (patch)
treebf93480018a52ab051189222248b6d04af98d7d4 /loginutils/sulogin.c
parent4ea83bf562c44a6792e7c77e7d87cba91f86f763 (diff)
downloadbusybox-w32-fdddab0c61c55c25d4218d4370e2b16a7936a794.tar.gz
busybox-w32-fdddab0c61c55c25d4218d4370e2b16a7936a794.tar.bz2
busybox-w32-fdddab0c61c55c25d4218d4370e2b16a7936a794.zip
make pw_encrypt() return malloc'ed string.
text data bss dec hex filename 759802 604 6684 767090 bb472 busybox_old 759804 604 6676 767084 bb46c busybox_unstripped
Diffstat (limited to 'loginutils/sulogin.c')
-rw-r--r--loginutils/sulogin.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index f52ce8a95..38812a6cc 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -72,6 +72,9 @@ int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv)
72#endif 72#endif
73 73
74 while (1) { 74 while (1) {
75 char *encrypted;
76 int r;
77
75 /* cp points to a static buffer that is zeroed every time */ 78 /* cp points to a static buffer that is zeroed every time */
76 cp = bb_askpass(timeout, 79 cp = bb_askpass(timeout,
77 "Give root password for system maintenance\n" 80 "Give root password for system maintenance\n"
@@ -81,7 +84,10 @@ int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv)
81 bb_info_msg("Normal startup"); 84 bb_info_msg("Normal startup");
82 return 0; 85 return 0;
83 } 86 }
84 if (strcmp(pw_encrypt(cp, pwd->pw_passwd, 1), pwd->pw_passwd) == 0) { 87 encrypted = pw_encrypt(cp, pwd->pw_passwd, 1);
88 r = strcmp(encrypted, pwd->pw_passwd);
89 free(encrypted);
90 if (r == 0) {
85 break; 91 break;
86 } 92 }
87 bb_do_delay(FAIL_DELAY); 93 bb_do_delay(FAIL_DELAY);