From: Roman Haritonov Date: Wed, 10 Sep 2014 08:31:56 +0000 (+0400) Subject: [rgw][s3] Allow colon ':' in access key X-Git-Tag: v0.86~101^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a05e6b8b9473f188d503525e8e3dbdf374372ff;p=ceph.git [rgw][s3] Allow colon ':' in access key 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 --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index abe37677ce5e..b5a7a7266d6e 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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;