Unix administration - Why can't I rename this file?

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > May 2004 > Why can't I rename this file?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Why can't I rename this file?
Dan

2004-05-13, 12:52 pm

Why can't I rename this file under my normal login?

$ pwd
/var/tmp
$ ls -ld
drwxrwxrwt 3 bin bin 83456 May 13 11:51 .
$ ls -l ar.exp
-rw-rw-rw- 1 root system 2150739 May 12 23:22 ar.exp
$ mv ar.exp art.exp
mv: 0653-401 Cannot rename ar.exp to art.exp:
Operation not permitted.

TIA,
Dan
phn@icke-reklam.ipsec.nu

2004-05-13, 1:40 pm

Dan <dan@nospam.com> wrote:
> Why can't I rename this file under my normal login?


> $ pwd
> /var/tmp
> $ ls -ld
> drwxrwxrwt 3 bin bin 83456 May 13 11:51 .
> $ ls -l ar.exp
> -rw-rw-rw- 1 root system 2150739 May 12 23:22 ar.exp
> $ mv ar.exp art.exp
> mv: 0653-401 Cannot rename ar.exp to art.exp:
> Operation not permitted.


Note the 't' bit on the directory. From the manpage (FreeBSD) :
1000 (the sticky bit) When set on a directory, unprivileged
users can delete and rename only those files in the direc_
tory that are owned by them, regardless of the permissions
on the directory. Under FreeBSD, the sticky bit is ignored
for executable files and may only be set for directories
(see sticky(8)).


AIX is strange, but in this respect unix-compatible.

> TIA,
> Dan


--
Peter Håkanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.
Barry Margolin

2004-05-13, 1:40 pm

In article <CLNoc.34$pe4.49155@news.uswest.net>, Dan <dan@nospam.com>
wrote:

> Why can't I rename this file under my normal login?
>
> $ pwd
> /var/tmp
> $ ls -ld
> drwxrwxrwt 3 bin bin 83456 May 13 11:51 .
> $ ls -l ar.exp
> -rw-rw-rw- 1 root system 2150739 May 12 23:22 ar.exp
> $ mv ar.exp art.exp
> mv: 0653-401 Cannot rename ar.exp to art.exp:
> Operation not permitted.


The directory's sticky bit is set. Only the owner of a file or the
owner of the directory may remove or rename the file.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com