]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Enable partial matching for server commands.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 5 Sep 2016 15:34:53 +0000 (17:34 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
The feature was deactivated in an earlier commit which converted the
lsatt command to lopsub. The problem was that "ls" would have been
interpreted as lsatt because lsatt was the only converted command
that started with ls.

Now that all server commands are converted, the lopsub library function
lls_lookup_subcmd() does the right thing, so this patch removes the
additional test for an exact match.

command.c

index 9cf8b049cf2acb76bbc4329b83472e2b74f17de9..8608f309292ff13dc74bc43b5e2b0b5bdc04807f 100644 (file)
--- a/command.c
+++ b/command.c
@@ -872,8 +872,7 @@ static int run_command(struct command_context *cc, struct iovec *iov,
        p[iov->iov_len - 1] = '\0'; /* just to be sure */
 
        ret = lls(lls_lookup_subcmd(p, server_cmd_suite, &errctx));
        p[iov->iov_len - 1] = '\0'; /* just to be sure */
 
        ret = lls(lls_lookup_subcmd(p, server_cmd_suite, &errctx));
-       if (ret >= 0 && !strcmp(p, lls_command_name(lls_cmd(ret,
-                       server_cmd_suite)))) {
+       if (ret >= 0) {
                perms = server_command_perms[ret];
                if ((perms & cc->u->perms) != perms)
                        return -E_PERM;
                perms = server_command_perms[ret];
                if ((perms & cc->u->perms) != perms)
                        return -E_PERM;