1 /* vi: set sw=4 ts=4: */
3 * /etc/securetty checking.
5 * Licensed under GPLv2, see file LICENSE in this source tree.
9 int FAST_FUNC is_tty_secure(const char *short_tty)
11 char *buf = (char*)"/etc/securetty"; /* any non-NULL is ok */
12 parser_t *parser = config_open2("/etc/securetty", fopen_for_read);
13 while (config_read(parser, &buf, 1, 1, "# \t", PARSE_NORMAL)) {
14 if (strcmp(buf, short_tty) == 0)
19 /* buf != NULL here if config file was not found, empty
20 * or line was found which equals short_tty.
21 * In all these cases, we report "this tty is secure".