X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=command.c;h=c378563379777fe3c7af5f1bc352871f9b6dbd55;hb=6e0b28e02a1013c019a3225e922b71f913bfbae4;hp=5d6a0990597165bc5b17a7cfaf5595e73955ca09;hpb=16c6fc10f3344e3eec66e51580821d854d49aa62;p=paraslash.git diff --git a/command.c b/command.c index 5d6a0990..c3785633 100644 --- a/command.c +++ b/command.c @@ -40,12 +40,16 @@ #include "signal.h" #include "version.h" +typedef int server_command_handler_t(struct command_context *); +static server_command_handler_t SERVER_COMMAND_HANDLERS; +server_command_handler_t AFS_COMMAND_HANDLERS; + /* Defines one command of para_server. */ struct server_command { /* The name of the command. */ const char *name; /* Pointer to the function that handles the command. */ - int (*handler)(struct command_context *); + server_command_handler_t *handler; /* The privileges a user must have to execute this command. */ unsigned int perms; /* One-line description of the command. */ @@ -167,7 +171,7 @@ static int check_sender_args(int argc, char * const * argv, struct sender_comman const char *subcmds[] = {"add", "delete", "allow", "deny", "on", "off", NULL}; scd->sender_num = -1; - if (argc < 2) + if (argc < 3) return -E_COMMAND_SYNTAX; for (i = 0; senders[i].name; i++) if (!strcmp(senders[i].name, argv[1]))