/** \file command.c does client authentication and executes server commands */
-
#include <malloc.h> /* mallinfo */
#include <sys/time.h> /* gettimeofday */
#include "crypt.h"
#include "send.h"
#include "rc4.h"
#include <openssl/rc4.h>
-#include "gcc-compat.h"
#include "error.h"
#include "net.h"
#include "daemon.h"
.name = "cdt",
.handler = com_cdt,
.perms = DB_READ | DB_WRITE,
-.description = "change database tool",
-.synopsis = "cdt [name_of_new_dbtool]",
+.description = "change the current audio file selector",
+.synopsis = "cdt [new_selector]",
.help =
-"Deactivate current dbtool and activate name_of_new_dbtool. If no\n"
-"argument was given, print the current database tool.\n"
+"Shutdown the current selector and activate new_selector. If no\n"
+"argument was given, print the name of the current selector.\n"
},
{
return para_strdup("paused");
}
-
/*
* return human readable permission string. Never returns NULL.
*/
*handler = para_strdup("para_server"); /* server commands */
return cmd;
}
- /* not found, look for dbtool commands */
+ /* not found, look for commands supported by the current selector */
mmd_lock();
if (handler)
*handler = make_message("the %s database tool", dblist[mmd->dbt_num].name);
sscanf(cmdstr, "%200s%n", buf, &n);
if (!n)
- return NULL;
+ return NULL;
buf[n] = '\0';
return get_cmd_ptr(buf, NULL);
}
return (long int) ((max + 0.0) * (random() / (RAND_MAX + 1.0)));
}
-
/* Open user_list file, returns pointer to opened file on success,
* NULL on errors
*/
PARA_DEBUG_LOG("rc4 keys initialized (%u:%u)\n",
(unsigned char) rc4_buf[0],
(unsigned char) rc4_buf[RC4_KEY_LEN]);
- RC4_set_key(&rc4_recv_key, RC4_KEY_LEN, rc4_buf);
- RC4_set_key(&rc4_send_key, RC4_KEY_LEN, rc4_buf + RC4_KEY_LEN);
+ RC4_set_key(&rc4_recv_key, RC4_KEY_LEN, rc4_buf);
+ RC4_set_key(&rc4_send_key, RC4_KEY_LEN, rc4_buf + RC4_KEY_LEN);
}
static void rc4_recv(unsigned long len, const unsigned char *indata, unsigned char *outdata)
{
- RC4(&rc4_recv_key, len, indata, outdata);
+ RC4(&rc4_recv_key, len, indata, outdata);
}
+
static void rc4_send(unsigned long len, const unsigned char *indata, unsigned char *outdata)
{
- RC4(&rc4_send_key, len, indata, outdata);
+ RC4(&rc4_send_key, len, indata, outdata);
}
-
-
-
int handle_connect(int fd, struct sockaddr_in *addr)
{
int numbytes, ret, argc, use_rc4 = 0;