#include "signal.h"
#include "version.h"
-struct server_command afs_cmds[] = {DEFINE_AFS_CMD_ARRAY};
-struct server_command server_cmds[] = {DEFINE_SERVER_CMD_ARRAY};
+static struct server_command afs_cmds[] = {DEFINE_AFS_CMD_ARRAY};
+static struct server_command server_cmds[] = {DEFINE_SERVER_CMD_ARRAY};
/** Commands including options must be shorter than this. */
#define MAX_COMMAND_LEN 32768
int ret;
struct sb_context *sbc;
struct iovec iov[2];
- struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
sb_transformation trafo = band < SBD_PROCEED? NULL : sc_trafo;
+ struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
sbc = sb_new_send(&sbb, dont_free, trafo, scc->send);
do {
if (ret < 0)
goto out;
end = iov->iov_base + iov->iov_len;
- for (i = 0, p = iov->iov_base; p < end; i++)
+ for (i = 0; p < end; i++)
p += strlen(p) + 1;
cc->argc = i;
cc->argv = para_malloc((cc->argc + 1) * sizeof(char *));
int ret;
unsigned char rand_buf[CHALLENGE_SIZE + 2 * SESSION_KEY_LEN];
unsigned char challenge_hash[HASH_SIZE];
- char *p, *command = NULL, *buf = para_malloc(HANDSHAKE_BUFSIZE) /* must be on the heap */;
+ char *command = NULL, *buf = para_malloc(HANDSHAKE_BUFSIZE) /* must be on the heap */;
size_t numbytes;
struct command_context cc_struct = {.peer = peername}, *cc = &cc_struct;
struct iovec iov;
ret = parse_auth_request(buf, ret, &cc->u);
if (ret < 0)
goto net_err;
- p = buf + strlen(AUTH_REQUEST_MSG);
- PARA_DEBUG_LOG("received auth request for user %s\n", p);
- cc->u = lookup_user(p);
if (cc->u) {
get_random_bytes_or_die(rand_buf, sizeof(rand_buf));
ret = pub_encrypt(cc->u->pubkey, rand_buf, sizeof(rand_buf),