bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [bug #45037] wget -O foo ftp://ftp.funet.fi/pub/Linux/mir


From: Darshit Shah
Subject: Re: [Bug-wget] [bug #45037] wget -O foo ftp://ftp.funet.fi/pub/Linux/mirrors/debian/README deletes README symlink
Date: Thu, 7 May 2015 13:56:50 +0530

Aah! It was a quick patch I wrote and had tested only one scenario.
Which is why I wanted some reviews before pushing it.

Seems like it'll take slightly more effort to fix this. I'll take a
look again today evening.

On Thu, May 7, 2015 at 1:04 PM, Tim Ruehsen <address@hidden> wrote:
> Hi Darshit,
>
> your patch doesn't work as expected.
>
> $ cat abc >xxx
> $ ln -s xxx foo
> $ ln -s /etc/passwd README
> $ ../src/wget -O foo ftp://ftp.funet.fi/pub/Linux/mirrors/debian/README
> ...
>
> $ ls -la
> lrwxrwxrwx 1 oms users   11 May  7 09:28 README -> /etc/passwd
> -rw-r--r-- 1 oms users 1495 May  7 09:30 xxx
>
> 'foo' doesn't exist and 'xxx' has been overwritten !!!
>
> Regards, Tim
>
>
> On Thursday 07 May 2015 10:06:55 Darshit Shah wrote:
>> >address@hidden:~/tmp/y>ln -s /etc/passwd README
>> >address@hidden:~/tmp/y>ls
>> >README@
>> >address@hidden:~/tmp/y>wget -O foo
>> >ftp://ftp.funet.fi/pub/Linux/mirrors/debian/README
>> >--2015-05-05 13:17:22--  ftp://ftp.funet.fi/pub/Linux/mirrors/debian/README
>> >
>> >           => 'foo'
>> >
>> >Resolving ftp.funet.fi (ftp.funet.fi)... 193.166.3.2, 2001:708:10:9::20:2
>> >Connecting to ftp.funet.fi (ftp.funet.fi)|193.166.3.2|:21... connected.
>> >Logging in as anonymous ... Logged in!
>> >==> SYST ... done.    ==> PWD ... done.
>> >==> TYPE I ... done.  ==> CWD (1) /pub/Linux/mirrors/debian ... done.
>> >==> SIZE README ... 1495
>> >==> PASV ... done.    ==> RETR README ... done.
>> >Length: 1495 (1.5K) (unauthoritative)
>> >
>> >README              100%[=====================>]   1.46K  5.45KB/s   in
>> >0.3s
>> >
>> >
>> >2015-05-05 13:17:28 (5.45 KB/s) - 'foo' saved [1495]
>> >
>> >address@hidden:~/tmp/y>ls
>> >foo
>> >
>> >Doesn't happen if README is a file rather than a symlink, doesn't happen
>> >when using http. The ftp downloader apparently has a bug..
>>
>> This definitely is a bug. I've attached a small fix for this particular
>> issue. If no one has any issues with it, I'll push it in a day.
>>
>> Although, I think we should also look into the issue Giuseppe found, and
>> also the point that Angel raised about compatibility with shell like
>> redirection.



-- 
Thanking You,
Darshit Shah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]