summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/middleware/gswauth/bin/swauth-prep
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2013-11-22 12:13:09 +0530
committerLuis Pabon <lpabon@redhat.com>2013-12-05 09:15:40 -0800
commitfc9124caf45949dfcc0732536c6825c12d74582a (patch)
treead9871cda75a8c5f08e4a06d88a38836b674c8c5 /gluster/swift/common/middleware/gswauth/bin/swauth-prep
parent0eb79aad3658ca519143029f219c9efe3591e724 (diff)
gswauth: Fix 403 being returned instead of 401
- 401(Unauthorized) is to be returned when user credentials are wrong where as 403(Forbidden) is to be returned when user credentials are correct but the user doesn't have the priveleges to carry out the operation. - Also error messages displayed when using swauth-* command line utilities have been updated. Change-Id: I485786896ad14d3263f4325d1857cacc93adab96 Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/6336 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster/swift/common/middleware/gswauth/bin/swauth-prep')
-rwxr-xr-xgluster/swift/common/middleware/gswauth/bin/swauth-prep7
1 files changed, 6 insertions, 1 deletions
diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-prep b/gluster/swift/common/middleware/gswauth/bin/swauth-prep
index bf2384f..f520426 100755
--- a/gluster/swift/common/middleware/gswauth/bin/swauth-prep
+++ b/gluster/swift/common/middleware/gswauth/bin/swauth-prep
@@ -56,4 +56,9 @@ if __name__ == '__main__':
ssl=(parsed.scheme == 'https'))
resp = conn.getresponse()
if resp.status // 100 != 2:
- exit('Auth subsystem prep failed: %s %s' % (resp.status, resp.reason))
+ if resp.status == 401:
+ exit('gswauth preparation failed: %s %s: Invalid user/key provided' %
+ (resp.status, resp.reason))
+ else:
+ exit('gswauth preparation failed: %s %s' %
+ (resp.status, resp.reason))