fixfiles: make sure $LOGFILE starts with a slash
PATCH 1/1 fixfiles: make sure $LOGFILE starts with a slash
tty may output a (localized) "not a tty" message to stdout and exit with a zero status in case ttyname(3) returns NULL but isatty(3) returns success. This happens at least when stdin is connected to a tty but we're inside a chroot with no access to the tty file.
This results in an error:
/usr/sbin/fixfiles: line 257: $LOGFILE: ambiguous redirect
Handle tty results that don't start with a slash the same way as no tty
errors: point $LOGFILE to /dev/null.
Signed-off-by Oskari Saarenmaa <[email protected]>
--- policycoreutils/scripts/fixfiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/scripts/fixfiles +1 -1
@@ -120,7 +120,7 @@ FORCEFLAG="" DIRS="" RPMILES="" LOGFILE=`tty` -if [ $? != 0 ]; then +if [ $? != 0 -o ${LOGFILE:0:1} != "/" ]; then LOGFILE="/dev/null" fi LOGGER=/usr/sbin/logger
Signature · 1 line
2.5.5