From 4c721049c3114c946848fbbd38d6180aa7af537d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 4 Apr 2010 23:45:09 +0200 Subject: who: fix attempts to open '/dev/dev/ttyX'; make columns a bit wider, add -H function old new delta who_main 292 363 +71 Signed-off-by: Denys Vlasenko --- loginutils/login.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'loginutils') diff --git a/loginutils/login.c b/loginutils/login.c index b5e348b66..256c7c475 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -61,7 +61,7 @@ static void read_or_build_utent(struct utmp *utptr, int run_by_root) /* First, try to find a valid utmp entry for this process. */ /* If there is one, just use it. */ - while ((ut = getutent()) != NULL) + while ((ut = getutent()) != NULL) { if (ut->ut_pid == pid && ut->ut_line[0] && ut->ut_id[0] && (ut->ut_type == LOGIN_PROCESS || ut->ut_type == USER_PROCESS) ) { @@ -70,6 +70,7 @@ static void read_or_build_utent(struct utmp *utptr, int run_by_root) memset(utptr->ut_host, 0, sizeof(utptr->ut_host)); return; } + } // Why? Do we require non-root to exec login from another // former login process (e.g. login shell)? Some login's have -- cgit v1.2.3