diff options
author | Karel Zak | 2016-07-14 13:07:25 +0200 |
---|---|---|
committer | Karel Zak | 2016-07-14 13:07:25 +0200 |
commit | 85a37ca8d14060a29b46fc677eeed19c8a99db5e (patch) | |
tree | 90544fbf8618df1293d863d9adcfa409b65c81c9 /login-utils | |
parent | sulogin: remove __nonnull__ function attribute (diff) | |
parent | lib: try to find tty in get_terminal_name() (diff) | |
download | kernel-qcow2-util-linux-85a37ca8d14060a29b46fc677eeed19c8a99db5e.tar.gz kernel-qcow2-util-linux-85a37ca8d14060a29b46fc677eeed19c8a99db5e.tar.xz kernel-qcow2-util-linux-85a37ca8d14060a29b46fc677eeed19c8a99db5e.zip |
Merge branch 'write-improvements' of git://github.com/kerolasa/lelux-utiliteetit
* 'write-improvements' of git://github.com/kerolasa/lelux-utiliteetit:
lib: try to find tty in get_terminal_name()
write: stop removing and adding /dev/ in front of tty string
write: tell when effective gid and tty path group mismatch
write: improve coding style
write: remove PUTC macro
write: make timestamp to be obviously just a clock time
write: remove unnecessary utmp variables
write: improve function and variable names
write: add control structure to clarify what is going on
write: run atexit() checks at the end of execution
write: use xstrncpy() from strutils.h
write: set atime value in term_chk() only when needed
write: remove pointless fileno(3) calls
write: get rid of function prototypes
write: remove unused variable
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/login.c | 2 | ||||
-rw-r--r-- | login-utils/su-common.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/login-utils/login.c b/login-utils/login.c index 4d71f5424..7501f6d69 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -356,7 +356,7 @@ static void init_tty(struct login_context *cxt) cxt->tty_mode = (mode_t) getlogindefs_num("TTYPERM", TTY_MODE); - get_terminal_name(0, &cxt->tty_path, &cxt->tty_name, &cxt->tty_number); + get_terminal_name(&cxt->tty_path, &cxt->tty_name, &cxt->tty_number); /* * In case login is suid it was possible to use a hardlink as stdin diff --git a/login-utils/su-common.c b/login-utils/su-common.c index 78a734c67..1776b6b79 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -165,7 +165,7 @@ log_syslog(struct passwd const *pw, bool successful) old_user = pwd ? pwd->pw_name : ""; } - if (get_terminal_name(STDERR_FILENO, NULL, &tty, NULL) != 0 || !tty) + if (get_terminal_name(NULL, &tty, NULL) != 0 || !tty) tty = "none"; openlog (program_invocation_short_name, 0 , LOG_AUTH); @@ -192,7 +192,7 @@ static void log_btmp(struct passwd const *pw) pw && pw->pw_name ? pw->pw_name : "(unknown)", sizeof(ut.ut_user)); - get_terminal_name(STDERR_FILENO, NULL, &tty_name, &tty_num); + get_terminal_name(NULL, &tty_name, &tty_num); if (tty_num) xstrncpy(ut.ut_id, tty_num, sizeof(ut.ut_id)); if (tty_name) |