Fix setting keywords in the SSH interface.
diff mbox

Message ID 20170720215143.29007-1-eschwartz@archlinux.org
State Accepted, archived
Headers show

Commit Message

Eli Schwartz July 20, 2017, 9:51 p.m. UTC
This was broken in commit 8914a41db938194efc021f842c89d47ff6b522c9 which
refactored the argument parsing. Instead of checking for at least the
set-keywords command and a pkgbase name, we were checking for *exactly*
the command and pkgbase name, leaving no room for keywords...

As a result, while we could clear the keywords, we could not set them.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 aurweb/git/serve.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lukas Fleischer July 21, 2017, 4:47 p.m. UTC | #1
On Thu, 20 Jul 2017 at 23:51:43, Eli Schwartz wrote:
> This was broken in commit 8914a41db938194efc021f842c89d47ff6b522c9 which
> refactored the argument parsing. Instead of checking for at least the
> set-keywords command and a pkgbase name, we were checking for *exactly*
> the command and pkgbase name, leaving no room for keywords...
> 
> As a result, while we could clear the keywords, we could not set them.
> 
> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
> ---
>  aurweb/git/serve.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/aurweb/git/serve.py b/aurweb/git/serve.py
> index 3eef26a..eea0c9c 100755
> --- a/aurweb/git/serve.py
> +++ b/aurweb/git/serve.py
> @@ -502,7 +502,7 @@ def serve(action, cmdargv, user, privileged, remote_addr):
>          cmd = action + " '" + repo_path + "'"
>          os.execl(git_shell_cmd, git_shell_cmd, '-c', cmd)
>      elif action == 'set-keywords':
> -        checkarg(cmdargv, 'repository name')
> +        checkarg_atleast(cmdargv, 'repository name')

Looks fine to me. Thanks!

>          pkgbase_set_keywords(cmdargv[1], cmdargv[2:])
>      elif action == 'list-repos':
>          checkarg(cmdargv)
> -- 
> 2.13.3

Patch
diff mbox

diff --git a/aurweb/git/serve.py b/aurweb/git/serve.py
index 3eef26a..eea0c9c 100755
--- a/aurweb/git/serve.py
+++ b/aurweb/git/serve.py
@@ -502,7 +502,7 @@  def serve(action, cmdargv, user, privileged, remote_addr):
         cmd = action + " '" + repo_path + "'"
         os.execl(git_shell_cmd, git_shell_cmd, '-c', cmd)
     elif action == 'set-keywords':
-        checkarg(cmdargv, 'repository name')
+        checkarg_atleast(cmdargv, 'repository name')
         pkgbase_set_keywords(cmdargv[1], cmdargv[2:])
     elif action == 'list-repos':
         checkarg(cmdargv)