Mailinglist Archive: opensuse (2731 mails)
| < Previous | Next > |
Re: [SLE] file permissions?
- From: "Michael Siefritz" <suse-linux-e@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Aug 2003 23:33:30 -0700
- Message-id: <20030828063330.2F917746C7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Thu, 28 Aug 2003 06:24:03 +0200, "Philipp Thomas"
<philipp.thomas@xxxxxxxxx> said:
> Mark Hounschell <dmarkh@xxxxxxxxxx> [Wed, 27 Aug 2003 16:26:50 -0400]:
> > So in linux there is no way to have some files in "a" directory that
> >are writable and some files that are not?
> Directly, no. But with a trick it's possible. Create the files in a
> directory that is owned by root and symlink them into the directory where
> the user has write permissions.
Check this out:
# cd /tmp
# mkdir xx
# chmod g+w,o+t xx
# sudo chown root xx
# ll -d xx
drwxrwxr-t 2 root users 35 Aug 27 23:24 xx
# cd xx
# touch yy
# sudo touch zz
# ll
total 0
-rw-r--r-- 1 msiefrit users 0 Aug 27 23:24 yy
-rw-r--r-- 1 root root 0 Aug 27 23:24 zz
# rm yy
# rm zz
rm: remove write-protected file `zz'? y
rm: cannot unlink `zz': Operation not permitted
#
>From the ulink man page:
EPERM or EACCES
The directory containing pathname has the sticky-
bit (S_ISVTX) set and the process's effective uid
is neither the uid of the file to be deleted nor
that of the directory containing it.
So with the sticky bit (t) set you need to own the file or the directory
to be able to delete the file.
HTH Michael
<philipp.thomas@xxxxxxxxx> said:
> Mark Hounschell <dmarkh@xxxxxxxxxx> [Wed, 27 Aug 2003 16:26:50 -0400]:
> > So in linux there is no way to have some files in "a" directory that
> >are writable and some files that are not?
> Directly, no. But with a trick it's possible. Create the files in a
> directory that is owned by root and symlink them into the directory where
> the user has write permissions.
Check this out:
# cd /tmp
# mkdir xx
# chmod g+w,o+t xx
# sudo chown root xx
# ll -d xx
drwxrwxr-t 2 root users 35 Aug 27 23:24 xx
# cd xx
# touch yy
# sudo touch zz
# ll
total 0
-rw-r--r-- 1 msiefrit users 0 Aug 27 23:24 yy
-rw-r--r-- 1 root root 0 Aug 27 23:24 zz
# rm yy
# rm zz
rm: remove write-protected file `zz'? y
rm: cannot unlink `zz': Operation not permitted
#
>From the ulink man page:
EPERM or EACCES
The directory containing pathname has the sticky-
bit (S_ISVTX) set and the process's effective uid
is neither the uid of the file to be deleted nor
that of the directory containing it.
So with the sticky bit (t) set you need to own the file or the directory
to be able to delete the file.
HTH Michael
| < Previous | Next > |