su: add a delay if the password is incorrect
authorRomain Naour <romain.naour@openwide.fr>
Sun, 16 Mar 2014 10:18:19 +0000 (11:18 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 16 Mar 2014 10:18:19 +0000 (11:18 +0100)
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/su.c

index c51f26f70f0a65fc1dde85a5ecffb8203ac50272..f8125054a412acc7f73afab3f944d3e4841e21e5 100644 (file)
@@ -101,6 +101,7 @@ int su_main(int argc UNUSED_PARAM, char **argv)
                if (ENABLE_FEATURE_SU_SYSLOG)
                        syslog(LOG_NOTICE, "%c %s %s:%s",
                                '-', tty, old_user, opt_username);
+               bb_do_delay(LOGIN_FAIL_DELAY);
                bb_error_msg_and_die("incorrect password");
        }