pycurl does not fail on authentication error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Smart Package Manager |
Fix Released
|
Undecided
|
Unassigned | ||
smart (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned | ||
Maverick |
Fix Released
|
Undecided
|
Unassigned | ||
Natty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Request for SRU
===============
0. This is fixed in oneiric with smart 1.4 (the fix was released in 1.3.1 upstream)
1. Statement explaining the impact
Smart doesn't catch 401 (and other 40x) errors when trying to download files from a repository. As a result, the html error page presented by the server is downloaded as if it were the requested file.
This usually leads to a weird error about the GPG signature being incorrect or being made with an unknown key:
"""
-> https:/
Release
#######
error: Channel 'lucid - main' signed with unknown key
"""
And these are the contents of the downloaded file:
"""
root@amra:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>
</body></html>
root@amra:
"""
2. How has the bug been addressed
A patch was taken from trunk to make pycurl fail on http errors and then catch this error:
bzr diff -r 947..948 lp:smart
3. Patch
That patch was applied to the source package and a debdiff was generated for each ubuntu release.
4. How to reproduce
- install smartpm-core
- add this line to your sources.list:
deb https:/
- run smart update as root
- with the broken package, you will get a gpg signature error when that repository is fetched:
"""
-> https:/
Release #######
error: Channel 'lucid - main' signed with unknown key
"""
- with the fixed package, you will get a proper 401 error:
"""
# smart update
(...)
-> https:/
Release [ 66%]
error: Download of Release failed for channel 'lucid - main': The requested URL returned error: 401
"""
5. Regression potential
- In both cases, before and after the patch, smart update would fail. With the patch, it fails with the correct error message.
- Without the patch, if the repository's signature isn't checked, the error is even more cryptic:
"""
warning: Component 'main' is not in Release file for channel 'lucid - main'
"""
That's because the release file that was downloaded is actually the 401 html error page.
- the patch has a test
- I don't know of any other side effects of setting handle.
Original bug description follows
=======
Imported: http://
Reason for Import: Patch Review
further details: https:/
msg1153 (view) Author: peter-endian Date: 2007-06-21.13:35:42
When you use python-curl, curl downloads the error message if authentication
fails and stores it as the respective xml file, with which smart is not very
happy of course.
The attached patch (against 0.50) sets the curl configuration option which
causes curl to fail if an authentication error occurrs, which then causes smart
to print out the error and consider the download not to be ok instead of writing
the errormessage down to the file.
Changed in smart: | |
milestone: | none → 1.3.1 |
Changed in smart: | |
status: | New → Fix Committed |
Changed in smart: | |
status: | Fix Committed → Fix Released |
description: | updated |
Changed in smart (Ubuntu): | |
status: | New → Fix Released |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
Fix for lucid.