On 00:45 30 Jan 2003, nate <[EMAIL PROTECTED]> wrote:
| Dan Bar Dov said:
| > If the file is owned by the user, touch will modify its last-mod-time.
| > This is contrary to my understanding that a read only file cannot be
| > modified (unless I insist as in rm -f)
| > Is this standard on all Unixes?
|
| if the file is owned by the same user that is 'touching' it, that
| user can override any permissions.

Um, NO. The user can _change_ the permissions, then do stuff, then
change them back, because they own it. But if the user permissions say
"no write access" then until they change them the user can't write to
the file. That's what the user set of permssions is for!

However, touch uses the utime() call, not actual file data writing,
and this date change is permitted. You still can't change the data
unless you change the permissions first.

| try, e.g. vi a read-only file by the user, then try to save it, it
| will say it's read only, then save it with :w! it will happily override
| it.

Not so.

Unless your vi (vim probably) is doing evil things like unlinking the
old file and making a new one, the above does not work.

| I think it's up to the particular program if it wants to deny access
| to the file based on permissions, I think most tend to ignore readonly
| permissions, becuase if the user really wants to write to it, they have
| full rights to change the permissions of the file and then write to
| it.

You're living in some weird fantasy land my friend. Programs must not
second guess policy, and permissions are policy. Fortunately the OS
prevents such stupidity in programs unless the program is truly offensive
and mods permissions without asking.

Cheers,
--
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

The question seems to be of such a character that if I should come to
life after my death and some mathematician were to tell me that it had
been definitely settled, I think I would immediately drop dead again.
        - Vandiver



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to