public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Backes <rtc@helen.PLASMA.Xg8.DE>
To: linux-kernel@vger.kernel.org
Subject: Behaviour of access(x, X_OK) in 2.2 vs. 2.4
Date: Thu, 03 Jul 2003 00:41:21 +0200	[thread overview]
Message-ID: <3F037BB1.9318.32D79C1@localhost> (raw)

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


             reply	other threads:[~2003-07-02 22:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02 22:41 Peter Backes [this message]
2003-07-03 16:51 ` PATCH (2.2): Fix for misbehaving access(x, X_OK) Peter Backes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F037BB1.9318.32D79C1@localhost \
    --to=rtc@helen.plasma.xg8.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox