From 77d9d57a01b019c53aea8f013b4498042a4f8dba Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 5 Sep 2016 17:34:53 +0200 Subject: [PATCH] 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. --- command.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.39.5