dput crashes with incorrect arguments

Bug #327239 reported by David Futcher
2
Affects Status Importance Assigned to Milestone
dput (Ubuntu)
Fix Released
Low
Cody A.W. Somerville

Bug Description

Binary package hint: dput

dput crashes when you supply a host argument that does not appear in dput.cf. Instead of displaying a he;pful error message, it simply crashes with a traceback like:

Traceback (most recent call last):
  File "/usr/bin/dput", line 930, in <module>
    main()
  File "/usr/bin/dput", line 706, in main
    config.set(args[0], args[0], "")
  File "/usr/lib/python2.5/ConfigParser.py", line 358, in set
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'testhost'

It isn't much of a problem, it just might confuse new users if they have set up their config wrong. IMO, it should display a simple error message, such as "Specified host $x could not be found in dput config. Please check your spelling or ~/dput.cf".

David Futcher (bobbo)
Changed in dput:
importance: Undecided → Wishlist
Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

What version of dput are you using? I think I've fixed this in Jaunty.

Changed in dput:
status: New → Incomplete
Revision history for this message
David Futcher (bobbo) wrote :

Jaunty, with all current updates installed, so dput 0.9.2.37ubuntu1.

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

And what exactly did you type to produce the error above?

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

Please also attach your ~/.dput.cf

Changed in dput:
assignee: nobody → cody-somerville
importance: Wishlist → Low
status: Incomplete → Triaged
Revision history for this message
David Futcher (bobbo) wrote :

The original command I found this in was: "dput *.php <email address hidden>://var/www/veza.co.uk" (Was meaning to type SCP, but tiredness fail), which crashed with "ConfigParser.NoSectionError: No section: 'backend.php'". I then tried it with "dput bug fail" which gave a crash ending in "ConfigParser.NoSectionError: No section: 'bug'".

Revision history for this message
David Futcher (bobbo) wrote :

I found the source of the bug. The hostname checking stuff is being run *after* the call to config.set() on line 706, which is causing the crash, so just doesn't work.

Revision history for this message
David Futcher (bobbo) wrote :

@Cody, I have a patch that fixes this bug and another I found while playing around the the tool (if you ran dput with the -o flag and specified a host, dput would think that the host was the changes file it was looking for and return errors when it couldn't find it. It looks just like a typo to me (array[0:] makes no sense as it will just return the whole list), but is a bug all-in-all.

I don't know if the solution to this bug is as elegant or safe as it could be, but it works and I have run a few test uploads and it doesn't seem to interfere with anything. It would make sense for someone who knows the code better to have a proper look, but this is working with no problems for me.

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

Hi David,

 Thanks for the effort. Unfortunately, your proposed solution isn't quite right. Please feel free to take a look at my debdiff to see what I did.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dput - 0.9.2.37ubuntu2

---------------
dput (0.9.2.37ubuntu2) jaunty; urgency=low

  * dput:
    - Be more careful about setting a variable in a section that does not
      exist in host argument handling (Fixes LP: #327239)
    - Correctly handle cases where a non-existant host or no host at all is
      supplied when -o option is passed. (Thanks to David Futcher for spotting)

 -- <email address hidden> (Cody A.W. Somerville) Mon, 09 Feb 2009 18:02:26 -0400

Changed in dput:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.