X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=command.c;h=97924f227988a99a851a1df2c703946d05fbe3bf;hb=06e7fb50098513c14d08c82fa1579d7bd105dc5c;hp=8bef14983546a86757022e9974ddd6342ee936b0;hpb=556417e8fbcbec0f2123ea00a5698f94ebbbeb7d;p=paraslash.git diff --git a/command.c b/command.c index 8bef1498..97924f22 100644 --- a/command.c +++ b/command.c @@ -6,9 +6,13 @@ /** \file command.c does client authentication and executes server commands */ -#include /* gettimeofday */ -#include "para.h" /* gettimeofday */ +#include +#include +#include +#include +#include +#include "para.h" #include "server.cmdline.h" #include "afs_common.h" #include "afh.h" @@ -16,7 +20,6 @@ #include "vss.h" #include "send.h" #include "rc4.h" -#include #include "error.h" #include "net.h" #include "daemon.h" @@ -217,7 +220,7 @@ static int check_sender_args(int argc, char * const * argv, struct sender_comman case SENDER_ALLOW: if (argc != 4 && argc != 5) return -E_COMMAND_SYNTAX; - if (!inet_aton(argv[3], &scd->addr)) + if (!inet_pton(AF_INET, argv[3], &scd->addr)) return -E_COMMAND_SYNTAX; scd->netmask = 32; if (argc == 5) { @@ -230,7 +233,7 @@ static int check_sender_args(int argc, char * const * argv, struct sender_comman case SENDER_DELETE: if (argc != 4 && argc != 5) return -E_COMMAND_SYNTAX; - if (!inet_aton(argv[3], &scd->addr)) + if (!inet_pton(AF_INET, argv[3], &scd->addr)) return -E_COMMAND_SYNTAX; scd->port = -1; if (argc == 5) { @@ -473,7 +476,7 @@ static struct server_command *get_cmd_ptr(const char *name, char **handler) if (!strcmp(cmd->name, name)) return cmd; /* not found, look for commands supported by afs */ - for (cmd = afs_cmds; cmd; cmd++) + for (cmd = afs_cmds; cmd->name; cmd++) if (!strcmp(cmd->name, name)) return cmd; return NULL; @@ -499,7 +502,7 @@ int com_help(int fd, int argc, char * const * argv) if (ret < 0) return ret; cmd = afs_cmds; - ret = send_list_of_commands(fd, cmd, "afs"); + return send_list_of_commands(fd, cmd, "afs"); } /* argument given for help */ cmd = get_cmd_ptr(argv[1], &handler);