aboutsummaryrefslogtreecommitdiff
path: root/libbb/securetty.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-04-13 13:04:05 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-04-13 13:04:05 +0200
commita3de0b3b86deb37c2adc993c6357c1a31b7ecb5b (patch)
tree19aa5e71448b03b2aea9aa2cad42a9a5d9066dc1 /libbb/securetty.c
parent335681ca8e39144fa19814f7ba10d0fe760e4055 (diff)
downloadbusybox-w32-a3de0b3b86deb37c2adc993c6357c1a31b7ecb5b.tar.gz
busybox-w32-a3de0b3b86deb37c2adc993c6357c1a31b7ecb5b.tar.bz2
busybox-w32-a3de0b3b86deb37c2adc993c6357c1a31b7ecb5b.zip
libbb: make check_password() also return CHECKPASS_PW_HAS_EMPTY_PASSWORD
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/securetty.c')
-rw-r--r--libbb/securetty.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbb/securetty.c b/libbb/securetty.c
index 176cee129..67a123689 100644
--- a/libbb/securetty.c
+++ b/libbb/securetty.c
@@ -6,7 +6,7 @@
6 */ 6 */
7#include "libbb.h" 7#include "libbb.h"
8 8
9int FAST_FUNC check_securetty(const char *short_tty) 9int FAST_FUNC is_tty_secure(const char *short_tty)
10{ 10{
11 char *buf = (char*)"/etc/securetty"; /* any non-NULL is ok */ 11 char *buf = (char*)"/etc/securetty"; /* any non-NULL is ok */
12 parser_t *parser = config_open2("/etc/securetty", fopen_for_read); 12 parser_t *parser = config_open2("/etc/securetty", fopen_for_read);
@@ -17,6 +17,8 @@ int FAST_FUNC check_securetty(const char *short_tty)
17 } 17 }
18 config_close(parser); 18 config_close(parser);
19 /* buf != NULL here if config file was not found, empty 19 /* buf != NULL here if config file was not found, empty
20 * or line was found which equals short_tty */ 20 * or line was found which equals short_tty.
21 * In all these cases, we report "this tty is secure".
22 */
21 return buf != NULL; 23 return buf != NULL;
22} 24}