Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
why can I write to a file I don 't have perms to??

why can I write to a file I don 't have perms to??

2005-04-14       - By Tobias Speckbacher

 Back
Reply:     1     2     3     4     5     6  



> -- --Original Message-- --
> From: redhat-list-bounces@(protected)
> [mailto:redhat-list-bounces@(protected)]On Behalf Of
> David.Knight@(protected)
> Sent: Thursday, April 14, 2005 2:59 PM
> To: General Red Hat Linux discussion list
> Cc: redhat-list@(protected); redhat-list-bounces@(protected)
> Subject: Re: why can I write to a file I don't have perms to??
>
>
> David.Knight@(protected)
> Sent by: redhat-list-bounces@(protected)
> 04/14/2005 04:56 PM
> Please respond to General Red Hat Linux discussion list
>
>  
>         To:     redhat-list@(protected)
>         cc:
>         Subject:        why can I write to a file I don't own??
>
>
> RedHat List,
>         I was working on a script the other day and ran into
> an anomaly
> with the file permission's on files. I have checked this on
> several ES
> servers and all produce the same results. Say a file has the
> following
> perms: 644  and it is owner and group are root:root. as long
> as a user has
>
> write permission's to the directory it is in they can write
> to it.

This is how it is supposed to work.

>not
> only that the UID:GID change to that user. I am running ext3
> file systems
> with kernel 2.4.21-20.ELsmp. So my question is
>
> 1) why is this allowed?
> 2) can I change this?

yes create a directory as root and set the sticky bit on it, deposit the file
you want to protect inside this directory.
This should prevent the user from messing with the files.

http://www.linuxdevcenter.com/pub/a/linux/lpt/22_06.html

>
> # pwd
> /home/test_dir
> # rm test.fil
> # pwd
> /home/test_dir
> # ls -ld .
> drwxr-xr-x    2 user7  root         4096 Apr 14 16:56 .
> # id
> uid=0(root) gid=0(root)
> groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
> # echo "test from root" > test.fil
> # ls -l test.fil
> -rw-r--r--    1 root     root           15 Apr 14 16:57 test.fil
> # su - user7
> $vi test.fil
> $ ls -l test.fil
> -rw-r--r--    1 user7  user7        31 Apr 14 16:57 test.fil
> $ cat test.fil
> test from root
> test from uset7
>
> However it doesn't let you echo "test from user7" > ./test.fil. it
> responds correctly......
> Any thoughts on this would be great.
> -David Knight
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

Earn $52 per hosting referral at Lunarpages.