diff options
author | Rob Landley <rob@landley.net> | 2006-01-06 20:59:09 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-01-06 20:59:09 +0000 |
commit | 84cb76733f0e5853a6c7c2f64b1c168e61dfd933 (patch) | |
tree | e9315133e3d21ea032e5e676ddb3f39e18be5605 /loginutils/passwd.c | |
parent | 251161f75c0895a1138f87bd80d9bcc38e567444 (diff) | |
download | busybox-w32-84cb76733f0e5853a6c7c2f64b1c168e61dfd933.tar.gz busybox-w32-84cb76733f0e5853a6c7c2f64b1c168e61dfd933.tar.bz2 busybox-w32-84cb76733f0e5853a6c7c2f64b1c168e61dfd933.zip |
patch from tito: consolidate delay functions as bb_do_delay()
Diffstat (limited to 'loginutils/passwd.c')
-rw-r--r-- | loginutils/passwd.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 5d8380d4c..b60b8973e 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c | |||
@@ -323,7 +323,6 @@ static int new_password(const struct passwd *pw, int amroot, int algo) | |||
323 | char *cp; | 323 | char *cp; |
324 | char orig[200]; | 324 | char orig[200]; |
325 | char pass[200]; | 325 | char pass[200]; |
326 | time_t start, now; | ||
327 | 326 | ||
328 | if (!amroot && crypt_passwd[0]) { | 327 | if (!amroot && crypt_passwd[0]) { |
329 | if (!(clear = bb_askpass(0, "Old password:"))) { | 328 | if (!(clear = bb_askpass(0, "Old password:"))) { |
@@ -334,12 +333,7 @@ static int new_password(const struct passwd *pw, int amroot, int algo) | |||
334 | if (strcmp(cipher, crypt_passwd) != 0) { | 333 | if (strcmp(cipher, crypt_passwd) != 0) { |
335 | syslog(LOG_WARNING, "incorrect password for `%s'", | 334 | syslog(LOG_WARNING, "incorrect password for `%s'", |
336 | pw->pw_name); | 335 | pw->pw_name); |
337 | time(&start); | 336 | bb_do_delay(FAIL_DELAY); |
338 | now = start; | ||
339 | while (difftime(now, start) < FAIL_DELAY) { | ||
340 | sleep(FAIL_DELAY); | ||
341 | time(&now); | ||
342 | } | ||
343 | fprintf(stderr, "Incorrect password.\n"); | 337 | fprintf(stderr, "Incorrect password.\n"); |
344 | /* return -1; */ | 338 | /* return -1; */ |
345 | return 1; | 339 | return 1; |