Re: [PATCH v2] Add an option not to use link(src, dest) && unlink(src) when that is unreliable

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

 



Hi,

On Sat, 25 Apr 2009, Junio C Hamano wrote:

> So if you do:
> 
> 	cat >corrupt-move.c <<\EOF
> 	#include <unistd.h>
> 	int main(int ac, char **av)
>         {
>                 return (link(av[1], av[2]) || unlink(av[1]));
> 	}
> 	EOF
>         cc -o corrupt-move corrupt-move.c
>         ./corrupt-move corrupt-move.c corrupt-move.c.new
> 
> you end up with a corrupt-move.c.new file that is full of NUL?

I have not compiled and run this code, but I am _real_ sure that this is 
exactly the issue.

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]