From 5a05e6b8b9473f188d503525e8e3dbdf374372ff Mon Sep 17 00:00:00 2001 From: Roman Haritonov Date: Wed, 10 Sep 2014 12:31:56 +0400 Subject: [PATCH] [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 --- src/rgw/rgw_rest_s3.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index abe37677ce5..b5a7a7266d6 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; -- 2.47.3