From ae1f9848e5364d817da38639f078df30fe65eca7 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 14 Nov 2019 17:43:39 -0500 Subject: [PATCH] Fix bit testing logic --- gitsrht-shell/main.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gitsrht-shell/main.go b/gitsrht-shell/main.go index aa86e92..858a9a9 100644 --- a/gitsrht-shell/main.go +++ b/gitsrht-shell/main.go @@ -319,10 +319,18 @@ func main() { } } + agrant := "" + snotice := "" + if accessGrant != nil { + agrant = *accessGrant + } + if pusherSuspendNotice != nil { + snotice = *pusherSuspendNotice + } logger.Printf("repo ID %d; name '%s'; owner ID %d; owner name '%s'; " + "visibility '%s'; pusher type '%s'; pusher suspension notice '%s'; " + "access grant '%s'", repoId, repoName, repoOwnerId, repoOwnerName, - repoVisibility, pusherType, pusherSuspendNotice, accessGrant) + repoVisibility, pusherType, snotice, agrant) // We have everything we need, now we find out if the user is allowed to do // what they're trying to do. @@ -337,7 +345,7 @@ func main() { case "unlisted": hasAccess = ACCESS_READ case "private": - hasAccess = ACCESS_NONE + fallthrough default: hasAccess = ACCESS_NONE } @@ -346,7 +354,7 @@ func main() { case "r": hasAccess = ACCESS_READ case "rw": - hasAccess = ACCESS_WRITE + hasAccess = ACCESS_READ | ACCESS_WRITE default: hasAccess = ACCESS_NONE } -- 2.38.4