scsh-users
[Top] [All Lists]

file-readable?

To: scsh-bugs@martigny.ai.mit.edu
Subject: file-readable?
From: Bruno.Verlyck@inria.fr
Date: Fri, 19 May 1995 15:42:30 +0200
I believe that the current implementation of file-readable? could be more
reliable.  It assumes UFS semantics: it stats the file, then manually (?)
checks the permission bits.

For example, we use AFS.  Read access is controlled by 1 permission bit and
Access Control Lists.  There could be similar problems with NFS.

I'm inclined to think that access(2) is a better way to do this kind of
checks.  Sure, it's not reliable for root access (*); but at least, scsh
would answer what the system says: mine checks ACLs, so it'd be OK for AFS.

BTW, is there any hope to see scsh available on Dec alphas ?

Bruno.

(*): on my SunOS, access() says OK to root on a -rwx------ root-owned
NFS-mounted file, but root can't cat it.  BTW, guess what ?
 $ cat bookbrowser
 cat: write error: Permission denied
Unix, I love you.

In fact, access() seems to do the same checks than open().  In the previous
case, only read() will refuse with Permission denied.  So to be sure, one has
to read at least one char; this only works for files, and I don't see how it
could be extended to file-writable?...  NFS brain-damage.

<Prev in Thread] Current Thread [Next in Thread>