]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
[rgw][s3] Allow colon ':' in access key 2447/head
authorRoman Haritonov <reclosedev@gmail.com>
Wed, 10 Sep 2014 08:31:56 +0000 (12:31 +0400)
committerRoman Haritonov <rharitonov@asdco.ru>
Wed, 10 Sep 2014 16:45:52 +0000 (20:45 +0400)
When access key contains ':', e.g. `some_info:for_user',
authorization header looks like:

"AWS some_info:for_user:request_signature"

so `auth_str.find(':')` result in auth_id = "some_info",
auth_sign = "for_user:request_signature".

auth_str.rfind(':') solves this issue.

Signed-off-by: Roman Haritonov <reclosedev@gmail.com>
src/rgw/rgw_rest_s3.cc

index abe37677ce5e2faae1b2ec0c32356f7c5d31e9f2..b5a7a7266d6eea477de4d3b6e302dc0909807ea8 100644 (file)
@@ -2120,7 +2120,7 @@ int RGW_Auth_S3::authorize(RGWRados *store, struct req_state *s)
     if (strncmp(s->http_auth, "AWS ", 4))
       return -EINVAL;
     string auth_str(s->http_auth + 4);
-    int pos = auth_str.find(':');
+    int pos = auth_str.rfind(':');
     if (pos < 0)
       return -EINVAL;