]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command.c
aft.c: Add GPL header.
[paraslash.git] / command.c
index 1c1b300f2bb0352142f2745ef764077b0bfcf3f2..072b972cb5754122aa539178edbf6cf43a19d3e3 100644 (file)
--- a/command.c
+++ b/command.c
@@ -6,9 +6,12 @@
 
 /** \file command.c does client authentication and executes server commands */
 
-#include <sys/time.h> /* gettimeofday */
-#include "para.h" /* gettimeofday */
+#include <sys/time.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <openssl/rc4.h>
 
+#include "para.h"
 #include "server.cmdline.h"
 #include "afs_common.h"
 #include "afh.h"
@@ -16,7 +19,6 @@
 #include "vss.h"
 #include "send.h"
 #include "rc4.h"
-#include <openssl/rc4.h>
 #include "error.h"
 #include "net.h"
 #include "daemon.h"
@@ -28,7 +30,7 @@
 #include "afs_command_list.h"
 
 /** commands including options must be shorter than this */
-#define MAX_COMMAND_LEN 4096
+#define MAX_COMMAND_LEN 32768
 
 static RC4_KEY rc4_recv_key;
 static RC4_KEY rc4_send_key;
@@ -473,7 +475,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 +501,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);