From: Andre Noll Date: Mon, 5 Sep 2016 15:34:53 +0000 (+0200) Subject: Enable partial matching for server commands. X-Git-Tag: v0.6.0~2^2~56 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=77d9d57a01b019c53aea8f013b4498042a4f8dba;ds=sidebyside Enable partial matching for server commands. 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. --- diff --git a/command.c b/command.c index 9cf8b049..8608f309 100644 --- 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)); - 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;