Merge lp:~dobey/ubuntu/oneiric/couchdb/fix-780972 into lp:ubuntu/oneiric/couchdb

Proposed by dobey on 2011-09-13
Status: Merged
Merged at revision: 56
Proposed branch: lp:~dobey/ubuntu/oneiric/couchdb/fix-780972
Merge into: lp:ubuntu/oneiric/couchdb
Diff against target: 143 lines (+131/-0)
2 files modified
debian/changelog (+6/-0)
debian/patches/couchdb-svn1039345-backport.patch (+125/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/oneiric/couchdb/fix-780972
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve on 2011-09-13
Ubuntu branches 2011-09-13 Pending
Review via email: mp+75238@code.launchpad.net
To post a comment you must log in.
Mathieu Trudel-Lapierre (cyphermox) wrote :

It looks good, and builds fine. Uploading.

review: Approve

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-13 18:21:22 +0000
@@ -1,3 +1,9 @@
1couchdb (1.0.1-0ubuntu17) oneiric; urgency=high
2
3 * Backport svn r1039345 from 1.0.3 (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
=== added file 'debian/patches/couchdb-svn1039345-backport.patch'
--- debian/patches/couchdb-svn1039345-backport.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/couchdb-svn1039345-backport.patch 2011-09-13 18:21:22 +0000
@@ -0,0 +1,125 @@
1=== modified file 'src/erlang-oauth/oauth.app.in'
2--- old/src/erlang-oauth/oauth.app.in 2010-07-26 10:24:11 +0000
3+++ new/src/erlang-oauth/oauth.app.in 2011-09-13 17:32:12 +0000
4@@ -1,6 +1,6 @@
5 {application, oauth, [
6 {description, "Erlang OAuth implementation"},
7- {vsn, "dev"},
8+ {vsn, "7d85d3ef"},
9 {modules, [
10 oauth,
11 oauth_hmac_sha1,
12
13=== modified file 'src/erlang-oauth/oauth_hmac_sha1.erl'
14--- old/src/erlang-oauth/oauth_hmac_sha1.erl 2010-07-26 10:24:11 +0000
15+++ new/src/erlang-oauth/oauth_hmac_sha1.erl 2011-09-13 17:32:12 +0000
16@@ -8,4 +8,4 @@ signature(BaseString, CS, TS) ->
17 base64:encode_to_string(crypto:sha_mac(Key, BaseString)).
18
19 verify(Signature, BaseString, CS, TS) ->
20- couch_util:verify(signature(BaseString, CS, TS), Signature).
21+ Signature =:= signature(BaseString, CS, TS).
22
23=== modified file 'src/erlang-oauth/oauth_http.erl'
24--- old/src/erlang-oauth/oauth_http.erl 2009-08-24 15:44:14 +0000
25+++ new/src/erlang-oauth/oauth_http.erl 2011-09-13 17:32:12 +0000
26@@ -10,7 +10,7 @@ post(URL, Data) ->
27 request(post, {URL, [], "application/x-www-form-urlencoded", Data}).
28
29 request(Method, Request) ->
30- http:request(Method, Request, [{autoredirect, false}], []).
31+ httpc:request(Method, Request, [{autoredirect, false}], []).
32
33 response_params(Response) ->
34 oauth_uri:params_from_string(response_body(Response)).
35
36=== modified file 'src/erlang-oauth/oauth_plaintext.erl'
37--- old/src/erlang-oauth/oauth_plaintext.erl 2010-07-26 10:24:11 +0000
38+++ new/src/erlang-oauth/oauth_plaintext.erl 2011-09-13 17:32:12 +0000
39@@ -7,4 +7,4 @@ signature(CS, TS) ->
40 oauth_uri:calate("&", [CS, TS]).
41
42 verify(Signature, CS, TS) ->
43- couch_util:verify(signature(CS, TS), Signature).
44+ Signature =:= signature(CS, TS).
45
46=== modified file 'src/erlang-oauth/oauth_uri.erl'
47--- old/src/erlang-oauth/oauth_uri.erl 2009-08-24 15:44:14 +0000
48+++ new/src/erlang-oauth/oauth_uri.erl 2011-09-13 17:32:12 +0000
49@@ -6,14 +6,6 @@
50
51 -import(lists, [concat/1]).
52
53--define(is_uppercase_alpha(C), C >= $A, C =< $Z).
54--define(is_lowercase_alpha(C), C >= $a, C =< $z).
55--define(is_alpha(C), ?is_uppercase_alpha(C); ?is_lowercase_alpha(C)).
56--define(is_digit(C), C >= $0, C =< $9).
57--define(is_alphanumeric(C), ?is_alpha(C); ?is_digit(C)).
58--define(is_unreserved(C), ?is_alphanumeric(C); C =:= $-; C =:= $_; C =:= $.; C =:= $~).
59--define(is_hex(C), ?is_digit(C); C >= $A, C =< $F).
60-
61
62 normalize(URI) ->
63 case http_uri:parse(URI) of
64@@ -66,23 +58,41 @@ intersperse(_, [X]) -> [X];
65 intersperse(Sep, [X|Xs]) ->
66 [X, Sep|intersperse(Sep, Xs)].
67
68-decode(Chars) ->
69- decode(Chars, []).
70+-define(is_alphanum(C), C >= $A, C =< $Z; C >= $a, C =< $z; C >= $0, C =< $9).
71
72-decode([], Decoded) ->
73- lists:reverse(Decoded);
74-decode([$%,A,B|Etc], Decoded) when ?is_hex(A), ?is_hex(B) ->
75- decode(Etc, [erlang:list_to_integer([A,B], 16)|Decoded]);
76-decode([C|Etc], Decoded) when ?is_unreserved(C) ->
77- decode(Etc, [C|Decoded]).
78-
79-encode(Chars) ->
80- encode(Chars, []).
81-
82-encode([], Encoded) ->
83- lists:flatten(lists:reverse(Encoded));
84-encode([C|Etc], Encoded) when ?is_unreserved(C) ->
85- encode(Etc, [C|Encoded]);
86-encode([C|Etc], Encoded) ->
87- Value = io_lib:format("%~2.1.0s", [erlang:integer_to_list(C, 16)]),
88- encode(Etc, [Value|Encoded]).
89+encode(Term) when is_integer(Term) ->
90+ integer_to_list(Term);
91+encode(Term) when is_atom(Term) ->
92+ encode(atom_to_list(Term));
93+encode(Term) when is_list(Term) ->
94+ encode(lists:reverse(Term, []), []).
95+
96+encode([X | T], Acc) when ?is_alphanum(X); X =:= $-; X =:= $_; X =:= $.; X =:= $~ ->
97+ encode(T, [X | Acc]);
98+encode([X | T], Acc) ->
99+ NewAcc = [$%, dec2hex(X bsr 4), dec2hex(X band 16#0f) | Acc],
100+ encode(T, NewAcc);
101+encode([], Acc) ->
102+ Acc.
103+
104+decode(Str) when is_list(Str) ->
105+ decode(Str, []).
106+
107+decode([$%, A, B | T], Acc) ->
108+ decode(T, [(hex2dec(A) bsl 4) + hex2dec(B) | Acc]);
109+decode([X | T], Acc) ->
110+ decode(T, [X | Acc]);
111+decode([], Acc) ->
112+ lists:reverse(Acc, []).
113+
114+-compile({inline, [{dec2hex, 1}, {hex2dec, 1}]}).
115+
116+dec2hex(N) when N >= 10 andalso N =< 15 ->
117+ N + $A - 10;
118+dec2hex(N) when N >= 0 andalso N =< 9 ->
119+ N + $0.
120+
121+hex2dec(C) when C >= $A andalso C =< $F ->
122+ C - $A + 10;
123+hex2dec(C) when C >= $0 andalso C =< $9 ->
124+ C - $0.
125

Subscribers

People subscribed via source and target branches

to all changes: