View Issue Details

IDProjectCategoryView StatusLast Update
0002776CentOS-5wgetpublic2009-10-17 22:45
Reporterinejge 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.1 
Target VersionFixed in Version5.4 
Summary0002776: wget aborts if invoked with --no-clobber when it encounters existing file
DescriptionIf wget (1.10.2-7.el5) is run with --no-clobber, it will abort after determining that a file already exists locally. No further error is displayed. This can always be reproduced:

    for i in 1 2;do wget -nc http://www.example.com/index.html;done

If the first retrieval was successful, the second will fail.
Additional InformationAccording to my quick look at wget sources as shipped with CentOS, this occurs because of code rearrangement in the massive patch (wget-1.10.2-to11.patch) which is applied to the original. In the patched version, the test for "noclobber" is no longer within http_loop(), but one level deeper, in gethttp(). When this function returns RETROK after determining local existence of a file, a switch statement doesn't know how to deal with that value, and aborts.

I created a quick-and-dirty patch which changes the return value from RETROK to RETRUNNEEDED and should be applied after wget-1.10.2-to11.patch. After applying that patch, wget no longer aborts in the circumstances described above. Someone who knows more about wget should check for memory leaks and similar.
Tagsfixed in 5.4

Activities

2008-04-04 10:35

 

wget-1.10.2-noclobber.patch (347 bytes)
--- wget-1.10.2/src/http.c.old	2008-04-04 11:51:40.000000000 +0200
+++ wget-1.10.2/src/http.c	2008-04-04 11:54:28.000000000 +0200
@@ -1760,7 +1760,7 @@
           if (has_html_suffix_p (hs->local_file))
             *dt |= TEXTHTML;
 
-          return RETROK;
+          return RETRUNNEEDED;
         }
       else if (!ALLOW_CLOBBER)
         {
range

range

2008-04-04 13:19

administrator   ~0007093

You should report that upstream, if you think this should be changed, as the patch comes from there (we didn't change the sources when rebuilding).
range

range

2009-02-18 16:45

administrator   ~0008742

Still interested in getting that bug fixed?
andreu

andreu

2009-07-03 14:00

reporter   ~0009563

Yes, please, this is a very annoying bug to me.

I also saw it here, https://bugzilla.redhat.com/show_bug.cgi?id=199032

However it seems to work well in debian...
range

range

2009-07-03 15:02

administrator   ~0009565

https://bugzilla.redhat.com/show_bug.cgi?id=440682

Will be fixed in 5.4

Issue History

Date Modified Username Field Change
2008-04-04 10:35 inejge New Issue
2008-04-04 10:35 inejge File Added: wget-1.10.2-noclobber.patch
2008-04-04 13:19 range Note Added: 0007093
2009-02-18 16:45 range Note Added: 0008742
2009-07-03 14:00 andreu Note Added: 0009563
2009-07-03 15:02 range Note Added: 0009565
2009-07-03 15:03 range Status new => confirmed
2009-07-03 15:03 range Tag Attached: fixed in 5.4
2009-10-17 22:45 range Status confirmed => resolved
2009-10-17 22:45 range Fixed in Version => 5.4
2009-10-17 22:45 range Resolution open => fixed