Merge lp:~jsjgruber/ubuntu/oneiric/couchdb/couchdb.fix780972.r1039345 into lp:ubuntu/oneiric/couchdb

Proposed by John S. Gruber
Status: Rejected
Rejected by: Stéphane Graber
Proposed branch: lp:~jsjgruber/ubuntu/oneiric/couchdb/couchdb.fix780972.r1039345
Merge into: lp:ubuntu/oneiric/couchdb
Diff against target: 139 lines (+48/-32)
6 files modified
debian/changelog (+6/-0)
src/erlang-oauth/oauth.app.in (+1/-1)
src/erlang-oauth/oauth_hmac_sha1.erl (+1/-1)
src/erlang-oauth/oauth_http.erl (+1/-1)
src/erlang-oauth/oauth_plaintext.erl (+1/-1)
src/erlang-oauth/oauth_uri.erl (+38/-28)
To merge this branch: bzr merge lp:~jsjgruber/ubuntu/oneiric/couchdb/couchdb.fix780972.r1039345
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
Ubuntu branches Pending
Review via email: mp+74677@code.launchpad.net

Description of the change

Proposed fix for LP: #780972, cherry picking from couchdb upstream svn r1039345.

Test build is in ppa:jsjgruber/ppa couchdb -- 1.0.1-0ubuntu17~jsg4.whole.patch

i386 build log is at: https://launchpad.net/~jsjgruber/+archive/ppa/+build/2773697/+files/buildlog_ubuntu-oneiric-i386.couchdb_1.0.1-0ubuntu17%7Ejsg4.whole.patch_BUILDING.txt.gz

to test use the command:

python -c "from desktopcouch.application.server import *; d=DesktopDatabase('test', create=True)"

Which should return without a traceback. The bug causes this to produce an unauthorized exception.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

I'm voting my disapproval of this branch, not because I think the patch is bad, but because of how it is applied. Patches need to be files under debian/patches/ (like all the other patches in this package), and not direct changes in the tree. You also should not include your PPA ~version piece in the changelog version string for an upload into Ubuntu proper.

Since it was quick to do, I've went ahead and made another branch and proposed it, by making the changes into a proper patch, and tweaking the changelog entry, while still properly attributing the fix to you. It is at https://code.launchpad.net/~dobey/ubuntu/oneiric/couchdb/fix-780972/+merge/75238

Thanks.

review: Disapprove

Unmerged revisions

56. By John S. Gruber

Backport svn r1039345 from 1.0.3., fixing LP: #780972.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-06-14 17:47:09 +0000
+++ debian/changelog 2011-09-08 19:56:53 +0000
@@ -1,3 +1,9 @@
1couchdb (1.0.1-0ubuntu17~jsg4.whole.patch) oneiric; urgency=low
2
3 * Backport svn r1039345 from 1.0.3., fixing LP: #780972.
4
5 -- John S Gruber <johnsgruber@gmail.com> Fri, 02 Sep 2011 01:02:01 -0400
6
1couchdb (1.0.1-0ubuntu16) oneiric; urgency=low7couchdb (1.0.1-0ubuntu16) oneiric; urgency=low
28
3 * Update Spidermonkey 1.8.5 patchset to the more palatable ones I'm9 * Update Spidermonkey 1.8.5 patchset to the more palatable ones I'm
410
=== modified file 'src/erlang-oauth/oauth.app.in'
--- src/erlang-oauth/oauth.app.in 2010-07-26 10:24:11 +0000
+++ src/erlang-oauth/oauth.app.in 2011-09-08 19:56:53 +0000
@@ -1,6 +1,6 @@
1{application, oauth, [1{application, oauth, [
2 {description, "Erlang OAuth implementation"},2 {description, "Erlang OAuth implementation"},
3 {vsn, "dev"},3 {vsn, "7d85d3ef"},
4 {modules, [4 {modules, [
5 oauth,5 oauth,
6 oauth_hmac_sha1,6 oauth_hmac_sha1,
77
=== modified file 'src/erlang-oauth/oauth_hmac_sha1.erl'
--- src/erlang-oauth/oauth_hmac_sha1.erl 2010-07-26 10:24:11 +0000
+++ src/erlang-oauth/oauth_hmac_sha1.erl 2011-09-08 19:56:53 +0000
@@ -8,4 +8,4 @@
8 base64:encode_to_string(crypto:sha_mac(Key, BaseString)).8 base64:encode_to_string(crypto:sha_mac(Key, BaseString)).
99
10verify(Signature, BaseString, CS, TS) ->10verify(Signature, BaseString, CS, TS) ->
11 couch_util:verify(signature(BaseString, CS, TS), Signature).11 Signature =:= signature(BaseString, CS, TS).
1212
=== modified file 'src/erlang-oauth/oauth_http.erl'
--- src/erlang-oauth/oauth_http.erl 2009-08-24 15:44:14 +0000
+++ src/erlang-oauth/oauth_http.erl 2011-09-08 19:56:53 +0000
@@ -10,7 +10,7 @@
10 request(post, {URL, [], "application/x-www-form-urlencoded", Data}).10 request(post, {URL, [], "application/x-www-form-urlencoded", Data}).
1111
12request(Method, Request) ->12request(Method, Request) ->
13 http:request(Method, Request, [{autoredirect, false}], []).13 httpc:request(Method, Request, [{autoredirect, false}], []).
1414
15response_params(Response) ->15response_params(Response) ->
16 oauth_uri:params_from_string(response_body(Response)).16 oauth_uri:params_from_string(response_body(Response)).
1717
=== modified file 'src/erlang-oauth/oauth_plaintext.erl'
--- src/erlang-oauth/oauth_plaintext.erl 2010-07-26 10:24:11 +0000
+++ src/erlang-oauth/oauth_plaintext.erl 2011-09-08 19:56:53 +0000
@@ -7,4 +7,4 @@
7 oauth_uri:calate("&", [CS, TS]).7 oauth_uri:calate("&", [CS, TS]).
88
9verify(Signature, CS, TS) ->9verify(Signature, CS, TS) ->
10 couch_util:verify(signature(CS, TS), Signature).10 Signature =:= signature(CS, TS).
1111
=== modified file 'src/erlang-oauth/oauth_uri.erl'
--- src/erlang-oauth/oauth_uri.erl 2009-08-24 15:44:14 +0000
+++ src/erlang-oauth/oauth_uri.erl 2011-09-08 19:56:53 +0000
@@ -6,14 +6,6 @@
66
7-import(lists, [concat/1]).7-import(lists, [concat/1]).
88
9-define(is_uppercase_alpha(C), C >= $A, C =< $Z).
10-define(is_lowercase_alpha(C), C >= $a, C =< $z).
11-define(is_alpha(C), ?is_uppercase_alpha(C); ?is_lowercase_alpha(C)).
12-define(is_digit(C), C >= $0, C =< $9).
13-define(is_alphanumeric(C), ?is_alpha(C); ?is_digit(C)).
14-define(is_unreserved(C), ?is_alphanumeric(C); C =:= $-; C =:= $_; C =:= $.; C =:= $~).
15-define(is_hex(C), ?is_digit(C); C >= $A, C =< $F).
16
179
18normalize(URI) ->10normalize(URI) ->
19 case http_uri:parse(URI) of11 case http_uri:parse(URI) of
@@ -66,23 +58,41 @@
66intersperse(Sep, [X|Xs]) ->58intersperse(Sep, [X|Xs]) ->
67 [X, Sep|intersperse(Sep, Xs)].59 [X, Sep|intersperse(Sep, Xs)].
6860
69decode(Chars) ->61-define(is_alphanum(C), C >= $A, C =< $Z; C >= $a, C =< $z; C >= $0, C =< $9).
70 decode(Chars, []).62
7163encode(Term) when is_integer(Term) ->
72decode([], Decoded) ->64 integer_to_list(Term);
73 lists:reverse(Decoded);65encode(Term) when is_atom(Term) ->
74decode([$%,A,B|Etc], Decoded) when ?is_hex(A), ?is_hex(B) ->66 encode(atom_to_list(Term));
75 decode(Etc, [erlang:list_to_integer([A,B], 16)|Decoded]);67encode(Term) when is_list(Term) ->
76decode([C|Etc], Decoded) when ?is_unreserved(C) ->68 encode(lists:reverse(Term, []), []).
77 decode(Etc, [C|Decoded]).69
7870encode([X | T], Acc) when ?is_alphanum(X); X =:= $-; X =:= $_; X =:= $.; X =:= $~ ->
79encode(Chars) ->71 encode(T, [X | Acc]);
80 encode(Chars, []).72encode([X | T], Acc) ->
8173 NewAcc = [$%, dec2hex(X bsr 4), dec2hex(X band 16#0f) | Acc],
82encode([], Encoded) ->74 encode(T, NewAcc);
83 lists:flatten(lists:reverse(Encoded));75encode([], Acc) ->
84encode([C|Etc], Encoded) when ?is_unreserved(C) ->76 Acc.
85 encode(Etc, [C|Encoded]);77
86encode([C|Etc], Encoded) ->78decode(Str) when is_list(Str) ->
87 Value = io_lib:format("%~2.1.0s", [erlang:integer_to_list(C, 16)]),79 decode(Str, []).
88 encode(Etc, [Value|Encoded]).80
81decode([$%, A, B | T], Acc) ->
82 decode(T, [(hex2dec(A) bsl 4) + hex2dec(B) | Acc]);
83decode([X | T], Acc) ->
84 decode(T, [X | Acc]);
85decode([], Acc) ->
86 lists:reverse(Acc, []).
87
88-compile({inline, [{dec2hex, 1}, {hex2dec, 1}]}).
89
90dec2hex(N) when N >= 10 andalso N =< 15 ->
91 N + $A - 10;
92dec2hex(N) when N >= 0 andalso N =< 9 ->
93 N + $0.
94
95hex2dec(C) when C >= $A andalso C =< $F ->
96 C - $A + 10;
97hex2dec(C) when C >= $0 andalso C =< $9 ->
98 C - $0.

Subscribers

People subscribed via source and target branches