[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rm: cannot unlink `sendmail': Operation not permitted



On Fri, May 24, 2002 at 08:16:25AM +1000, Jason Lim wrote:
> Hi all,
> 
> This is happening on a Redhat 7.2 system, but i think it would apply
> across all Linux distros.
> 
> [root@linux1 sbin]# pwd
> /usr/sbin
> [root@linux1 sbin]# chattr -iu sendmail
> [root@linux1 sbin]# rm sendmail
> rm: remove `sendmail'? y
> rm: cannot unlink `sendmail': Operation not permitted
> 
> [root@linux1 sbin]# ls -al sendmail
> -rwxr-xr-x   1 root     root        99161 May  1 01:21 sendmail
> 
> That is happening for all the files in that directory.
> 
> strace rm sendmail:
> 
> lstat64("sendmail", {st_mode=S_IFREG|0755, st_size=99161, ...}) = 0
> access("sendmail", W_OK)                = 0
> unlink("sendmail")                      = -1 EPERM (Operation not
> permitted)
> 
> Any ideas as to what may be happening?

  nnorman@foo:~ $ mkdir test
  nnorman@foo:~ $ cd test
  nnorman@foo:~/test $ touch biff
  nnorman@foo:~/test $ sudo chattr +i .
  nnorman@foo:~/test $ lsattr biff
  -------------- biff
  nnorman@foo:~/test $ ls -l biff
  -rw-rw-r--    1 nnorman  nnorman         0 May 23 17:35 biff
  nnorman@foo:~/test $ rm biff
  rm: cannot unlink `biff': Permission denied
  nnorman@foo:~/test $ lsattr -d .
  ---i---------- .

Check the directory.

-- 
Nathan Norman - Micromuse Ltd.  mailto:nnorman@micromuse.com
Gil-galad was an Elven-king.            |  The Fellowship
Of him the harpers sadly sing:          |        of
the last whose realm was fair and free  |     the Ring
between the Mountains and the Sea.      |  J.R.R. Tolkien

Attachment: pgpm_dtkjmgVW.pgp
Description: PGP signature


Reply to: