public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Behaviour of access(x, X_OK) in 2.2 vs. 2.4
@ 2003-07-02 22:41 Peter Backes
  2003-07-03 16:51 ` PATCH (2.2): Fix for misbehaving access(x, X_OK) Peter Backes
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Backes @ 2003-07-02 22:41 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm still using linux 2.2 and I noticed today that the behaviour of 
the access() system call concerning the execution permission (X_OK), 
if invoked by uid 0, has been changed in 2.4.  In 2.4 it seems to 
take the execute permission bit into account while in 2.2, for uid 0, 
it returns success (0) independent from it, although execve fails if 
invoked on a file without x bit.  The difference can be demonstrated 
quite easily using the bash builtin test command on a file without x 
bit, which (like /usr/bin/access from tetex and unlike /usr/bin/test 
from sh-utils) seems to use access(): 

On 2.2: 
bash# cd /tmp && touch xx && test -x xx && echo x || echo y
x

although

bash# cd /tmp && cp /bin/echo . && chmod 0 echo && ./echo
bash: ./echo: Permission denied

On 2.4:
bash# cd /tmp && touch xx && test -x xx && echo x || echo y
y

(Note this assumes an umask of 0022.)

I searched the web, newsgroups and mailing list archives about this 
problem, to no avail.  Is there some backport, workaround or patch 
for 2.2 to get the same (and obsiously more sane) behaviour as in 
2.4?

Please make sure you CC me if you reply as I'm not subscribed. 
-- Peter 'Rattacresh' Backes, rtc@helen.PLASMA.Xg8.DE


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-03 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-02 22:41 Behaviour of access(x, X_OK) in 2.2 vs. 2.4 Peter Backes
2003-07-03 16:51 ` PATCH (2.2): Fix for misbehaving access(x, X_OK) Peter Backes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox