GNU bug report logs - #12954
Differences between 'su' version give different results

Previous Next

Package: coreutils;

Reported by: ybronhei <ybronhei <at> redhat.com>

Date: Wed, 21 Nov 2012 16:52:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ybronhei <ybronhei <at> redhat.com>
To: 12954 <at> debbugs.gnu.org
Cc: Dan Kenigsberg <danken <at> redhat.com>
Subject: bug#12954: Differences between 'su' version give different results
Date: Wed, 21 Nov 2012 18:07:22 +0200
Differences between 'su' version give different results in the following 
shell script:

# !/bin/sh

func() {
su user > /dev/null 2>&1 << EOF
echo >> /tmp/b
EOF
}

if func; then
   echo "access"
else
   echo "no access"
fi

over fedora 17 I run - coreutils 8.15-8: if the file is not accessible 
by user the script prints no access, and the other way around.
over rhel 6.3 we run - coreutils 8.4: the result of func is always 
"access" without any dependency of the file permissions.. My first guess 
was that it returns 0 because the 'su' command was succeeded, but with 
strace you see that the script runs differently.

Is it a bug?

Thanks.

-- 
Yaniv Bronhaim.
RedHat, Israel
09-7692289
054-7744187





This bug report was last modified 12 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.