I suspect the problem is in how vim is writing the file.  If it is deleting
the original file first (which is allowed because the directory is writable
by the user), then creating the new file with the old name, it works with
the given permissions.

The vi that is used on Solaris may be attempting to open the existing file
for writing, which isn't allowed by the permissions.

So, to prevent an user from changing the file, not only does the permissions
have to be write for the file, but the directories have to be setup correct.

While testing, I did an echo HI >> tmp.file, and it failed because it wasn't
writable by the user.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Schaerfke, Marco, Dr.,
Xzillion/DE
Sent: Tuesday, January 29, 2002 3:32 AM
To: '[EMAIL PROTECTED]'
Subject: user can edit root file, why ?


Hi,
I use RH 7.1 and have problems with user rights. I have done the following
steps:

as root:

mkdir /test
touch /test/file.txt
chmod 644 /test/file.txt
chown user:group /test
Now the the directory belongs to user "user", but the owner of the file
"file.txt" is root.

as user "user"

vi /test/file.txt
(vi says that the file "file.txt" is read only)
but with  the vi-command w! it is possible for user "user" to modify the
file.

I check this behavior on other unix machines (Irix and Solaris). On this
plattforms its impossible to modify this file as user "user" (This is that
what I would expect also for linux).
Can anybody help me ?

Thanks

Marco





_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to