From 76bc0cc92f8c22e17383dc5a17175618a7ab3467 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 29 Oct 2014 22:06:50 +0100 Subject: stdin is closed, use stderr for ttyname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/logging | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging b/src/logging index 45e4815..8e8e14b 100755 --- a/src/logging +++ b/src/logging @@ -21,7 +21,7 @@ # Login username, client hostname if non-local, ttyname, cerberus-hook and PID username= hostname= -ttyname="$(tty | cut -d / -f 1,2 --complement)" +ttyname="$(tty <&2 | cut -d / -f 1,2 --complement)" hook="${1}" pid=$PPID if [ ! "${LOGIN_PID}" = "" ]; then -- cgit v1.2.3-70-g09d2