#define HANDSHAKE_BUFSIZE 4096
-static int run_command(struct command_context *cc, struct iovec *iov,
- const char *peername)
+static int run_command(struct command_context *cc, struct iovec *iov)
{
int ret, i, argc;
char *p, *end, **argv;
p += strlen(p) + 1;
}
argv[argc] = NULL;
- PARA_NOTICE_LOG("calling com_%s() for %s@%s\n", lls_command_name(lcmd),
- cc->u->name, peername);
+ PARA_NOTICE_LOG("calling com_%s() for user %s\n",
+ lls_command_name(lcmd), cc->u->name);
ret = lls(lls_parse(argc, argv, lcmd, &lpr, &errctx));
if (ret >= 0) {
const struct server_cmd_user_data *ud = lls_user_data(lcmd);
* Perform user authentication and execute a command.
*
* \param fd The file descriptor to send output to.
- * \param peername Identifies the connecting peer.
*
* Whenever para_server accepts an incoming tcp connection on the port it
* listens on, it forks and the resulting child calls this function.
*
* \sa alarm(2), \ref crypt.c, \ref crypt.h.
*/
-__noreturn void handle_connect(int fd, const char *peername)
+__noreturn void handle_connect(int fd)
{
int ret;
unsigned char rand_buf[CHALLENGE_SIZE + 2 * SESSION_KEY_LEN];
ret = recv_sb(&cc->scc, SBD_COMMAND, MAX_COMMAND_LEN, &iov);
if (ret < 0)
goto net_err;
- ret = run_command(cc, &iov, peername);
+ ret = run_command(cc, &iov);
free(iov.iov_base);
if (ret < 0)
goto err_out;
memset(sct->argv[i], 0, strlen(sct->argv[i]));
i = sct->argc - 1 - lls_num_inputs(cmdline_lpr);
sprintf(sct->argv[i], "para_server (serving %s)", peer_name);
- handle_connect(new_fd, peer_name);
+ handle_connect(new_fd);
/* never reached*/
out:
if (ret < 0)
#define ENUM_STRING_VAL(_name) (lls_enum_string_val(OPT_UINT32_VAL(_name), \
lls_opt(LSG_SERVER_PARA_SERVER_OPT_ ## _name, CMD_PTR)))
-__noreturn void handle_connect(int fd, const char *peername);
+__noreturn void handle_connect(int fd);
void parse_config_or_die(bool reload);
char *server_get_tasks(void);