Currently the server commands are divided into two group: those
commands which are handled by the server process and those which
communicate with the afs process. This commit converts the commands of
the former group and the corresponding completers for para_client to
the lopsub suite format while the afs commands will be converted in
subsequent commits. After this change para_server needs to be linked
with -llopsub.
To this aim the options and help texts of of the server commands are
transferred from server.cmd to the new server_cmd.suite.m4, enabling
long-style options in the progress. Moreover, an introduction is added
at the beginning of the list of server commands which describes how
server commands are executed.
Command permissions are now handled by making use of the aux_info
feature of lopsub. To keep those commands working which do not
have any permission bit set, we need to add a new identifier
NO_PERMISSION_REQUIRED to enum server_command_permissions of
user_list.h. The value of this identifier is zero of course.
Naturally the bulk of the change takes place in command.c where all
server commands are implemented. The command handlers are modified
to take a pointer to a struct lls_parse result as an additional
argument. A new helper, send_errctx(), is introduced to avoid code
duplication.
Since command.h now refers to a lopsub parse result, all files which
include command.h, including those which implement only afs commands,
need to include the system header lopsub.h.
To keep afs commands working, some compatibility code in run_command()
is added. This will go away after all commands have been converted.
A couple of macros in command.h ease the handling of the long symbolic
constants exposed by the generated lopsub header file.
Although only the non-afs commands are converted, the change allows
for a couple of cleanups:
* The E_BAD_COMMAND error code is no longer needed and has been
removed.
* cmd_perms_itohuman() has become unused and is removed.
* The server_cmds[] array is empty and can be removed, along
with the loop in send_list_of_commands() which iterated over
the array.
The patch also adjusts tests t0004 and t0005 since the help output
format changed slightly, breaking the expectations of these tests.