Re: BUG: git clean -d cannot remove files from read-only directories

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

 



Adam Milazzo <Adam.Milazzo@xxxxxxxxxxxxx> writes:

> Repro steps:
> 1. git init 
> 2. mkdir d
> 3. touch d/a
> 4. chmod -w d
> 5. git clean -fd
>
> Actual result:
> Git doesn't remove anything, saying "warning: failed to remove d/a".
>
> Expected result:
> Git should remove the subdirectory 'd' along with its
> contents. Note that git can remove a read-only file (touch b;
> chmod -w b; git clean -f) with no problem.

It is how UNIX-like filesystem works, isn't it?

As long as a directory D is writable/executable, any regular file
inside it can be removed regardless of the perm-bits of the file.

	mkdir d
	touch d/a
	chmod -w d
	rm d/a

would not let you remove the file d/a from d/, exactly because you
cannot modify d/ (it is not writable).



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux