uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
uname_rs := $(shell uname -rs)
cc_version := $(shell $(CC) --version | head -n 1)
-codename := deterministic entropy
+codename := infinite rollback
+
+GIT_VERSION := $(shell ./GIT-VERSION-GEN git-version.h)
DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
DEBUG_CPPFLAGS += -Wredundant-decls
+DEBUG_CPPFLAGS += -Wall
+DEBUG_CPPFLAGS += -Wformat-security
+DEBUG_CPPFLAGS += -Wmissing-format-attribute
# produces false positives
# DEBUG_CPPFLAGS += -Wunreachable-code
# DEBUG_CPPFLAGS += -Wwrite-strings
CPPFLAGS += -Wshadow
endif
CPPFLAGS += -Os
-CPPFLAGS += -Wall
CPPFLAGS += -Wuninitialized
CPPFLAGS += -Wchar-subscripts
-CPPFLAGS += -Wformat-security
CPPFLAGS += -DBINDIR='"$(BINDIR)"'
CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
CPPFLAGS += -DUNAME_RS='"$(uname_rs)"'
CPPFLAGS += -DCODENAME='"$(codename)"'
CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
CPPFLAGS += -Werror-implicit-function-declaration
-CPPFLAGS += -Wmissing-format-attribute
CPPFLAGS += -Wmissing-noreturn
CPPFLAGS += -Wunused-macros
CPPFLAGS += -Wbad-function-cast
CPPFLAGS += -fno-strict-aliasing
CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
- CPPFLAGS += @SSL_CPPFLAGS@
-CPPFLAGS += @ncurses_cppflags@
CPPFLAGS += @arch_cppflags@
CPPFLAGS += -I/usr/local/include
CPPFLAGS += -I$(cmdline_dir)
CPPFLAGS += @osl_cppflags@
-CPPFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"'
man_pages := $(patsubst %, man/man1/%.1, @executables@)
man_pages_in := $(patsubst %, web/%.man.in.html, @executables@)
Q =
endif
-.PHONY: dep all clean distclean maintainer-clean install man tarball\
- .FORCE-GIT-VERSION-FILE
+.PHONY: dep all clean distclean maintainer-clean install man tarball
all: dep @executables@ $(man_pages)
dep: $(deps)
man: $(man_pages)
tarball: $(tarball)
-GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
- @./GIT-VERSION-GEN GIT-VERSION-FILE
--include GIT-VERSION-FILE
-@executables@: GIT-VERSION-FILE
-
-include $(ggo_dir)/makefile
%_command_list.c: %.cmd
$(man_dir):
mkdir -p $@
+ $(object_dir)/crypt.o: crypt.c | $(object_dir)
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @openssl_cppflags@ $<
$(object_dir)/spx_common.o: spx_common.c | $(object_dir)
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ogg_cppflags@ $<
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+$(object_dir)/gui%.o: gui%.c | $(object_dir)
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @curses_cppflags@ $<
+
$(object_dir)/%.cmdline.o: $(cmdline_dir)/%.cmdline.c $(cmdline_dir)/%.cmdline.h | $(object_dir)
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c $(CPPFLAGS) -Wno-unused-function -o $@ $<
@[ -z "$(Q)" ] || echo 'DEP $<'
$(Q) ./depend.sh $(object_dir) $(cmdline_dir) $(CPPFLAGS) $< > $@
+
recv_objs := $(addprefix $(object_dir)/, @recv_objs@)
filter_objs := $(addprefix $(object_dir)/, @filter_objs@)
client_objs := $(addprefix $(object_dir)/, @client_objs@)
para_gui: $(gui_objs)
@[ -z "$(Q)" ] || echo 'LD $@'
- $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lncurses
+ $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lcurses
para_audiod: audiod_command_list.c audiod_command_list.h $(audiod_objs)
@[ -z "$(Q)" ] || echo 'LD $@'
git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
| tar --delete $(tarball_delete) > $(tarball_pfx).tar
mkdir -p $(tarball_pfx)/$(cmdline_dir)
- echo $(GIT_VERSION) > $(tarball_pfx)/VERSION
+ ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION
cp -r $(autocrap) $(tarball_pfx)
cp -r $(cmdline_generated) $(tarball_pfx)/$(cmdline_dir)
tar rf $(tarball_pfx).tar $(tarball_pfx)/*
------------------------------------------------
-0.4.6 (to be announced) "deterministic entropy"
------------------------------------------------
+-------------------------------------------
+0.4.7 (to be announced) "infinite rollback"
+-------------------------------------------
+
+ - configure: improved options for ogg/vorbis/speex.
+ - The git version reported by --version always matches HEAD.
+ - The autogen script detects the number of processors and
+ runs a parallel make if possible.
++ - Major cleanup of the crypto API.
+
+------------------------------------------
+0.4.6 (2011-03-31) "deterministic entropy"
+------------------------------------------
Lots of ogg/vorbis improvements, the new test suite, enhancements
for para_gui and a fair amount of other bug fixes.
/** \file afh.c Paraslash's standalone audio format handler tool. */
#include <regex.h>
- #include <dirent.h>
#include <sys/time.h>
#include "para.h"
#include "fd.h"
#include "afh.h"
#include "error.h"
+#include "version.h"
static struct afh_args_info conf;
/** The list of all status items */
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
#include "audioc.cmdline.h"
#include "para.h"
#include "net.h"
#include "string.h"
#include "fd.h"
+#include "version.h"
INIT_AUDIOC_ERRLISTS;
/** \file audiod.c the paraslash's audio daemon */
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
#include <signal.h>
- #include <openssl/rc4.h>
#include <stdbool.h>
#include "para.h"
#include "write.h"
#include "write_common.h"
#include "signal.h"
+#include "version.h"
/** define the array of error lists needed by para_audiod */
INIT_AUDIOD_ERRLISTS;
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
- #include <openssl/rc4.h>
#include "para.h"
#include "error.h"
#include "sched.h"
#include "client.cmdline.h"
#include "crypt.h"
- #include "rc4.h"
#include "net.h"
#include "fd.h"
#include "string.h"
#include "client.cmdline.h"
#include "client.h"
- #include "hash.h"
#include "buffer_tree.h"
+#include "version.h"
/** The size of the receiving buffer. */
#define CLIENT_BUFSIZE 4000
{
if (!ct)
return;
- if (ct->rc4c.fd >= 0)
- close(ct->rc4c.fd);
+ if (ct->scc.fd >= 0)
+ close(ct->scc.fd);
+ sc_free(ct->scc.recv);
+ sc_free(ct->scc.send);
free(ct->user);
free(ct->config_file);
free(ct->key_file);
struct client_task *ct = container_of(t, struct client_task, task);
struct btr_node *btrn = ct->btrn;
- if (ct->rc4c.fd < 0)
+ if (ct->scc.fd < 0)
return;
switch (ct->status) {
case CL_CONNECTED:
case CL_SENT_AUTH:
case CL_SENT_CH_RESPONSE:
case CL_SENT_COMMAND:
- para_fd_set(ct->rc4c.fd, &s->rfds, &s->max_fileno);
+ para_fd_set(ct->scc.fd, &s->rfds, &s->max_fileno);
return;
case CL_RECEIVED_WELCOME:
case CL_RECEIVED_PROCEED:
- para_fd_set(ct->rc4c.fd, &s->wfds, &s->max_fileno);
+ para_fd_set(ct->scc.fd, &s->wfds, &s->max_fileno);
return;
case CL_RECEIVING:
if (ret < 0)
sched_min_delay(s);
else
- para_fd_set(ct->rc4c.fd, &s->rfds,
+ para_fd_set(ct->scc.fd, &s->rfds,
&s->max_fileno);
}
return;
if (ret < 0)
sched_min_delay(s);
else
- para_fd_set(ct->rc4c.fd, &s->wfds,
+ para_fd_set(ct->scc.fd, &s->wfds,
&s->max_fileno);
}
return;
int ret;
if (ct->status < CL_SENT_CH_RESPONSE)
- return read_nonblock(ct->rc4c.fd, buf, sz, rfds, n);
+ return read_nonblock(ct->scc.fd, buf, sz, rfds, n);
*n = 0;
- ret = rc4_recv_buffer(&ct->rc4c, buf, sz);
+ ret = sc_recv_buffer(&ct->scc, buf, sz);
/*
- * rc4_recv_buffer is used with blocking fds elsewhere, so it
+ * sc_recv_buffer is used with blocking fds elsewhere, so it
* does not use the nonblock-API. Therefore we need to
* check for EOF and EAGAIN.
*/
char buf[CLIENT_BUFSIZE];
t->error = 0;
- if (ct->rc4c.fd < 0)
+ if (ct->scc.fd < 0)
return;
switch (ct->status) {
case CL_CONNECTED: /* receive welcome message */
case CL_RECEIVED_WELCOME: /* send auth command */
sprintf(buf, AUTH_REQUEST_MSG "%s", ct->user);
PARA_INFO_LOG("--> %s\n", buf);
- if (!FD_ISSET(ct->rc4c.fd, &s->wfds))
+ if (!FD_ISSET(ct->scc.fd, &s->wfds))
return;
- ret = send_buffer(ct->rc4c.fd, buf);
+ ret = send_buffer(ct->scc.fd, buf);
if (ret < 0)
goto out;
ct->status = CL_SENT_AUTH;
return;
case CL_SENT_AUTH:
/*
- * Receive challenge and rc4 keys, decrypt the challenge and
+ * Receive challenge and session keys, decrypt the challenge and
* send back the hash of the decrypted challenge.
*/
{
- /* decrypted challenge/rc4 buffer */
+ /* decrypted challenge/session key buffer */
unsigned char crypt_buf[1024];
/* the SHA1 of the decrypted challenge */
- unsigned char challenge_sha1[HASH_SIZE];
+ unsigned char challenge_hash[HASH_SIZE];
ret = client_recv_buffer(ct, &s->rfds, buf, sizeof(buf), &n);
if (ret < 0 || n == 0)
goto out;
PARA_INFO_LOG("<-- [challenge] (%zu bytes)\n", n);
- ret = para_decrypt_buffer(ct->key_file, crypt_buf,
+ ret = priv_decrypt(ct->key_file, crypt_buf,
(unsigned char *)buf, n);
if (ret < 0)
goto out;
- sha1_hash((char *)crypt_buf, CHALLENGE_SIZE, challenge_sha1);
- RC4_set_key(&ct->rc4c.send_key, RC4_KEY_LEN,
- crypt_buf + CHALLENGE_SIZE);
- RC4_set_key(&ct->rc4c.recv_key, RC4_KEY_LEN,
- crypt_buf + CHALLENGE_SIZE + RC4_KEY_LEN);
- hash_to_asc(challenge_sha1, buf);
+ hash_function((char *)crypt_buf, CHALLENGE_SIZE, challenge_hash);
+ ct->scc.send = sc_new(crypt_buf + CHALLENGE_SIZE, SESSION_KEY_LEN);
+ ct->scc.recv = sc_new(crypt_buf + CHALLENGE_SIZE + SESSION_KEY_LEN,
+ SESSION_KEY_LEN);
+ hash_to_asc(challenge_hash, buf);
PARA_INFO_LOG("--> %s\n", buf);
- ret = send_bin_buffer(ct->rc4c.fd, (char *)challenge_sha1,
+ ret = send_bin_buffer(ct->scc.fd, (char *)challenge_hash,
HASH_SIZE);
if (ret < 0)
goto out;
{
int i;
char *command = NULL;
- if (!FD_ISSET(ct->rc4c.fd, &s->wfds))
+ if (!FD_ISSET(ct->scc.fd, &s->wfds))
return;
for (i = 0; i < ct->conf.inputs_num; i++) {
char *tmp = command;
}
command = para_strcat(command, EOC_MSG "\n");
PARA_DEBUG_LOG("--> %s\n", command);
- ret = rc4_send_buffer(&ct->rc4c, command);
+ ret = sc_send_buffer(&ct->scc, command);
free(command);
if (ret < 0)
goto out;
goto out;
if (ret == 0)
return;
- if (!FD_ISSET(ct->rc4c.fd, &s->wfds))
+ if (!FD_ISSET(ct->scc.fd, &s->wfds))
return;
sz = btr_next_buffer(btrn, &buf2);
- ret = rc4_send_bin_buffer(&ct->rc4c, buf2, sz);
+ ret = sc_send_bin_buffer(&ct->scc, buf2, sz);
if (ret < 0)
goto out;
btr_consume(btrn, sz);
* The FD_ISSET() is not strictly necessary, but is allows us
* to skip the malloc below if there is nothing to read anyway.
*/
- if (!FD_ISSET(ct->rc4c.fd, &s->rfds))
+ if (!FD_ISSET(ct->scc.fd, &s->rfds))
return;
buf2 = para_malloc(CLIENT_BUFSIZE);
ret = client_recv_buffer(ct, &s->rfds, buf2, CLIENT_BUFSIZE, &n);
{
int ret;
- ct->rc4c.fd = -1;
+ ct->scc.fd = -1;
ret = para_connect_simple(IPPROTO_TCP, ct->conf.hostname_arg,
ct->conf.server_port_arg);
if (ret < 0)
return ret;
- ct->rc4c.fd = ret;
+ ct->scc.fd = ret;
ct->status = CL_CONNECTED;
- ret = mark_fd_nonblocking(ct->rc4c.fd);
+ ret = mark_fd_nonblocking(ct->scc.fd);
if (ret < 0)
goto err_out;
ct->task.pre_select = client_pre_select;
register_task(&ct->task);
return 1;
err_out:
- close(ct->rc4c.fd);
- ct->rc4c.fd = -1;
+ close(ct->scc.fd);
+ ct->scc.fd = -1;
return ret;
}
ct->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = "client", .parent = parent, .child = child));
*ct_ptr = ct;
- ct->rc4c.fd = -1;
+ ct->scc.fd = -1;
ret = -E_CLIENT_SYNTAX;
if (client_cmdline_parser(argc, argv, &ct->conf))
goto out;
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
- #include <dirent.h>
- #include <openssl/rc4.h>
#include <osl.h>
#include <stdbool.h>
#include "list.h"
#include "send.h"
#include "vss.h"
- #include "rc4.h"
#include "net.h"
#include "daemon.h"
#include "fd.h"
#include "afs_command_list.h"
#include "sched.h"
#include "signal.h"
+#include "version.h"
/** Commands including options must be shorter than this. */
#define MAX_COMMAND_LEN 32768
extern int mmd_mutex;
extern struct misc_meta_data *mmd;
extern struct sender senders[];
- int send_afs_status(struct rc4_context *rc4c, int parser_friendly);
+ int send_afs_status(struct stream_cipher_context *scc, int parser_friendly);
const char *status_item_list[] = {STATUS_ITEM_ARRAY};
return 1;
}
- int com_sender(struct rc4_context *rc4c, int argc, char * const * argv)
+ int com_sender(struct stream_cipher_context *scc, int argc, char * const * argv)
{
int i, ret;
char *msg = NULL;
free(msg);
msg = tmp;
}
- ret = rc4_send_buffer(rc4c, msg);
+ ret = sc_send_buffer(scc, msg);
free(msg);
return ret;
}
if (scd.sender_num < 0)
return ret;
msg = senders[scd.sender_num].help();
- ret = rc4_send_buffer(rc4c, msg);
+ ret = sc_send_buffer(scc, msg);
free(msg);
return ret;
}
}
/* server info */
- int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_si(struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
int i, ret;
char *ut;
free(info);
}
ut = uptime_str();
- ret = rc4_send_va_buffer(rc4c, "version: " GIT_VERSION "\n"
+ ret = sc_send_va_buffer(scc, "version: " GIT_VERSION "\n"
"up: %s\nplayed: %u\n"
"server_pid: %d\n"
"afs_pid: %d\n"
}
/* version */
- int com_version(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_version(struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
- return rc4_send_buffer(rc4c, VERSION_TEXT("server")
+ return sc_send_buffer(scc, VERSION_TEXT("server")
"built: " BUILD_DATE "\n"
UNAME_RS ", " CC_VERSION "\n"
);
#undef EMPTY_STATUS_ITEMS
/* stat */
- int com_stat(struct rc4_context *rc4c, int argc, char * const * argv)
+ int com_stat(struct stream_cipher_context *scc, int argc, char * const * argv)
{
int i, ret;
struct misc_meta_data tmp, *nmmd = &tmp;
for (;;) {
mmd_dup(nmmd);
s = get_status(nmmd, parser_friendly);
- ret = rc4_send_buffer(rc4c, s);
+ ret = sc_send_buffer(scc, s);
free(s);
if (ret < 0)
goto out;
static char *esi;
if (!esi)
esi = empty_status_items(parser_friendly);
- ret = rc4_send_buffer(rc4c, esi);
+ ret = sc_send_buffer(scc, esi);
if (ret < 0)
goto out;
} else
- send_afs_status(rc4c, parser_friendly);
+ send_afs_status(scc, parser_friendly);
ret = 1;
if (num > 0 && !--num)
goto out;
return ret;
}
- static int send_list_of_commands(struct rc4_context *rc4c, struct server_command *cmd,
+ static int send_list_of_commands(struct stream_cipher_context *scc, struct server_command *cmd,
const char *handler)
{
int ret, i;
for (i = 1; cmd->name; cmd++, i++) {
char *perms = cmd_perms_itohuman(cmd->perms);
- ret = rc4_send_va_buffer(rc4c, "%s\t%s\t%s\t%s\n", cmd->name,
+ ret = sc_send_va_buffer(scc, "%s\t%s\t%s\t%s\n", cmd->name,
handler,
perms,
cmd->description);
}
/* help */
- int com_help(struct rc4_context *rc4c, int argc, char * const * argv)
+ int com_help(struct stream_cipher_context *scc, int argc, char * const * argv)
{
struct server_command *cmd;
char *perms, *handler;
if (argc < 2) {
/* no argument given, print list of commands */
- if ((ret = send_list_of_commands(rc4c, server_cmds, "server")) < 0)
+ if ((ret = send_list_of_commands(scc, server_cmds, "server")) < 0)
return ret;
- return send_list_of_commands(rc4c, afs_cmds, "afs");
+ return send_list_of_commands(scc, afs_cmds, "afs");
}
/* argument given for help */
cmd = get_cmd_ptr(argv[1], &handler);
if (!cmd)
return -E_BAD_CMD;
perms = cmd_perms_itohuman(cmd->perms);
- ret = rc4_send_va_buffer(rc4c,
+ ret = sc_send_va_buffer(scc,
"%s - %s\n\n"
"handler: %s\n"
"permissions: %s\n"
}
/* hup */
- int com_hup(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_hup(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
}
/* term */
- int com_term(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_term(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
return 1;
}
- int com_play(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_play(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
}
/* stop */
- int com_stop(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_stop(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
}
/* pause */
- int com_pause(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_pause(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
}
/* next */
- int com_next(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_next(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
}
/* nomore */
- int com_nomore(__a_unused struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
+ int com_nomore(__a_unused struct stream_cipher_context *scc, int argc, __a_unused char * const * argv)
{
if (argc != 1)
return -E_COMMAND_SYNTAX;
}
/* ff */
- int com_ff(__a_unused struct rc4_context *rc4c, int argc, char * const * argv)
+ int com_ff(__a_unused struct stream_cipher_context *scc, int argc, char * const * argv)
{
long promille;
int ret, backwards = 0;
}
/* jmp */
- int com_jmp(__a_unused struct rc4_context *rc4c, int argc, char * const * argv)
+ int com_jmp(__a_unused struct stream_cipher_context *scc, int argc, char * const * argv)
{
long unsigned int i;
int ret;
return get_cmd_ptr(buf, NULL);
}
- static int read_command(struct rc4_context *rc4c, char **result)
+ static int read_command(struct stream_cipher_context *scc, char **result)
{
int ret;
char buf[4096];
size_t numbytes;
char *p;
- ret = rc4_recv_buffer(rc4c, buf, sizeof(buf));
+ ret = sc_recv_buffer(scc, buf, sizeof(buf));
if (ret < 0)
goto out;
if (!ret)
* calls this function.
*
* An RSA-based challenge/response is used to authenticate
- * the peer. It that authentication succeeds, a random RC4
+ * the peer. It that authentication succeeds, a random
* session key is generated and sent back to the peer,
* encrypted with its RSA public key. From this point on,
* all transfers are crypted with this session key.
* which terminates the function if the connection was not
* authenticated when the timeout expires.
*
- * \sa alarm(2), rc4(3), crypt.c, crypt.h
+ * \sa alarm(2), crypt.c, crypt.h
*/
__noreturn void handle_connect(int fd, const char *peername)
{
int ret, argc;
char buf[4096];
- unsigned char rand_buf[CHALLENGE_SIZE + 2 * RC4_KEY_LEN];
- unsigned char challenge_sha1[HASH_SIZE];
+ unsigned char rand_buf[CHALLENGE_SIZE + 2 * SESSION_KEY_LEN];
+ unsigned char challenge_hash[HASH_SIZE];
struct user *u;
struct server_command *cmd = NULL;
char **argv = NULL;
char *p, *command = NULL;
size_t numbytes;
- struct rc4_context rc4c = {.fd = fd};
+ struct stream_cipher_context scc = {.fd = fd};
reset_signals();
/* we need a blocking fd here as recv() might return EAGAIN otherwise. */
u = lookup_user(p);
if (u) {
get_random_bytes_or_die(rand_buf, sizeof(rand_buf));
- ret = para_encrypt_buffer(u->rsa, rand_buf, sizeof(rand_buf),
+ ret = pub_encrypt(u->pubkey, rand_buf, sizeof(rand_buf),
(unsigned char *)buf);
if (ret < 0)
goto net_err;
if (!u)
goto net_err;
/*
- * The correct response is the sha1 of the first CHALLENGE_SIZE bytes
+ * The correct response is the hash of the first CHALLENGE_SIZE bytes
* of the random data.
*/
ret = -E_BAD_AUTH;
if (numbytes != HASH_SIZE)
goto net_err;
- sha1_hash((char *)rand_buf, CHALLENGE_SIZE, challenge_sha1);
- if (memcmp(challenge_sha1, buf, HASH_SIZE))
+ hash_function((char *)rand_buf, CHALLENGE_SIZE, challenge_hash);
+ if (memcmp(challenge_hash, buf, HASH_SIZE))
goto net_err;
/* auth successful */
alarm(0);
PARA_INFO_LOG("good auth for %s\n", u->name);
- /* init rc4 keys with the second part of the random buffer */
- RC4_set_key(&rc4c.recv_key, RC4_KEY_LEN, rand_buf + CHALLENGE_SIZE);
- RC4_set_key(&rc4c.send_key, RC4_KEY_LEN, rand_buf + CHALLENGE_SIZE
- + RC4_KEY_LEN);
- ret = rc4_send_buffer(&rc4c, PROCEED_MSG);
+ /* init stream cipher keys with the second part of the random buffer */
+ scc.recv = sc_new(rand_buf + CHALLENGE_SIZE, SESSION_KEY_LEN);
+ scc.send = sc_new(rand_buf + CHALLENGE_SIZE + SESSION_KEY_LEN, SESSION_KEY_LEN);
+ ret = sc_send_buffer(&scc, PROCEED_MSG);
if (ret < 0)
goto net_err;
- ret = read_command(&rc4c, &command);
+ ret = read_command(&scc, &command);
if (ret == -E_COMMAND_SYNTAX)
goto err_out;
if (ret < 0)
argc = ret;
PARA_NOTICE_LOG("calling com_%s() for %s@%s\n", cmd->name, u->name,
peername);
- ret = cmd->handler(&rc4c, argc, argv);
+ ret = cmd->handler(&scc, argc, argv);
free_argv(argv);
mutex_lock(mmd_mutex);
mmd->num_commands++;
if (ret >= 0)
goto out;
err_out:
- rc4_send_va_buffer(&rc4c, "%s\n", para_strerror(-ret));
+ sc_send_va_buffer(&scc, "%s\n", para_strerror(-ret));
net_err:
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
out:
free(command);
+ sc_free(scc.recv);
+ sc_free(scc.send);
mutex_lock(mmd_mutex);
if (cmd && (cmd->perms & AFS_WRITE) && ret >= 0)
mmd->events++;
all_errlist_objs="server mp3_afh afh_common vss command net string signal time
daemon stat crypt http_send close_on_fork ipc acl afh fade amp_filter
dccp_send fd user_list chunk_queue afs aft mood score attribute blob ringbuffer
- playlist sha1 sched audiod grab_client filter_common wav_filter compress_filter
+ playlist sched audiod grab_client filter_common wav_filter compress_filter
http_recv dccp_recv recv_common write_common file_write audiod_command
client_common recv stdout filter stdin audioc write client exec send_common ggo
udp_recv udp_send color fec fecdec_filter prebuffer_filter mm
audiod_errlist_objs="audiod signal string daemon stat net
time grab_client filter_common wav_filter compress_filter amp_filter http_recv dccp_recv
recv_common fd sched write_common file_write audiod_command crypt fecdec_filter
- client_common ggo udp_recv color fec prebuffer_filter sha1 audiod_command_list
+ client_common ggo udp_recv color fec prebuffer_filter audiod_command_list
bitstream imdct wma_common wmadec_filter buffer_tree"
audiod_ldflags="-lm"
audiod_audio_formats="wma"
server_errlist_objs="server afh_common mp3_afh vss command net string signal
time daemon crypt http_send close_on_fork mm
ipc dccp_send fd user_list chunk_queue afs aft mood score attribute
- blob playlist sha1 sched acl send_common udp_send color fec
+ blob playlist sched acl send_common udp_send color fec
server_command_list afs_command_list wma_afh wma_common"
server_ldflags=""
server_audio_formats="mp3 wma"
client_cmdline_objs="add_cmdline(client)"
client_errlist_objs="client net string crypt fd sched stdin stdout time
- client_common sha1 buffer_tree"
+ client_common buffer_tree"
client_ldflags=""
gui_cmdline_objs="add_cmdline(gui)"
CPPFLAGS="$OLD_CPPFLAGS"
LDFLAGS="$OLD_LDFLAGS"
LIBS="$OLD_LIBS"
- ########################################################################### ssl
- dnl @synopsis CHECK_SSL
- dnl
- dnl based on the follwing macro from the autoconf archive
- dnl
- dnl @category InstalledPackages
- dnl @author Mark Ethan Trostler <trostler@juniper.net>
- dnl @version 2003-01-28
- dnl @license AllPermissive
-
- AC_DEFUN([CHECK_SSL],
- [
- for ssldir in $1 /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
- AC_MSG_CHECKING(for openssl in $ssldir)
- if test -f "$ssldir/include/openssl/ssl.h"; then
- found_ssl="yes"
- AC_MSG_RESULT(yes)
- SSL_CFLAGS="-I$ssldir/include"
- SSL_CPPFLAGS="-I$ssldir/include"
- break
- fi
- AC_MSG_RESULT(no)
- done
- if test x_$found_ssl != x_yes; then
- AC_MSG_ERROR(Cannot find ssl libraries)
- else
- SSL_LIBS="-lssl -lcrypto";
- SSL_LDFLAGS="-L$ssldir/lib";
+ ###################################################################### openssl
+ OLD_CPPFLAGS="$CPPFLAGS"
+ OLD_LD_FLAGS="$LDFLAGS"
+ OLD_LIBS="$LIBS"
+ have_openssl="yes"
+ AC_ARG_WITH(openssl_headers, [AC_HELP_STRING(--with-openssl-headers=dir,
+ [look for openssl headers also in dir])])
+ if test -n "$with_openssl_headers"; then
+ openssl_cppflags="-I$with_openssl_headers"
+ CPPFLAGS="$CPPFLAGS $openssl_cppflags"
+ fi
+ AC_ARG_WITH(openssl_libs, [AC_HELP_STRING(--with-openssl-libs=dir,
+ [look for openssl libraries also in dir])])
+ if test -n "$with_openssl_libs"; then
+ openssl_libs="-L$with_openssl_libs"
+ LDFLAGS="$LDFLAGS $openssl_libs"
+ fi
+ AC_CHECK_HEADER(openssl/ssl.h, [], [have_openssl="no"])
+ AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
+ if test "$have_openssl" = "no" -a -z "$with_openssl_headers$with_openssl_libs"; then
+ # try harder: openssl is sometimes installed in /usr/local/ssl
+ openssl_cppflags="-I/usr/local/ssl/include"
+ CPPFLAGS="$CPPFLAGS $openssl_cppflags"
+ openssl_libs="-L/usr/local/ssl/lib"
+ LDFLAGS="$LDFLAGS $openssl_libs"
+ # clear cache
+ unset ac_cv_header_openssl_ssl_h 2> /dev/null
+ unset ac_cv_lib_crypto_RAND_bytes 2> /dev/null
+ AC_CHECK_HEADER(openssl/ssl.h, [have_openssl="yes"], [])
+ if test "$have_openssl" = "yes"; then
+ AC_CHECK_LIB([crypto], [RAND_bytes], [], [have_openssl="no"])
fi
- AC_SUBST(SSL_CPPFLAGS)
- ])dnl
-
- AC_ARG_ENABLE(ssldir, [AS_HELP_STRING(--enable-ssldir=path,
- [Search for openssl also in path.])])
- if test "$enable_ssldir" = "yes"; then enable_ssldir=""; fi
- CHECK_SSL($enable_ssldir)
- server_ldflags="$server_ldflags $SSL_LDFLAGS $SSL_LIBS"
- client_ldflags="$client_ldflags $SSL_LDFLAGS $SSL_LIBS"
- audiod_ldflags="$audiod_ldflags $SSL_LDFLAGS $SSL_LIBS"
-
+ fi
+ if test "$have_openssl" = "yes"; then
+ AC_DEFINE(HAVE_OPENSSL, 1, [define to 1 to turn on openssl support])
+ AC_SUBST(openssl_cppflags)
+ openssl_libs="$openssl_libs -lssl -lcrypto"
+ server_ldflags="$server_ldflags $openssl_libs"
+ client_ldflags="$client_ldflags $openssl_libs"
+ audiod_ldflags="$audiod_ldflags $openssl_libs"
+ else
+ AC_MSG_ERROR([openssl libraries not found])
+ fi
+ CPPFLAGS="$OLD_CPPFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ LIBS="$OLD_LIBS"
########################################################################### libsocket
AC_CHECK_LIB([c], [socket],
[socket_lib=],
fi
########################################################################### curses
-have_ncurses="yes"
+have_curses="yes"
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LD_FLAGS="$LDFLAGS"
OLD_LIBS="$LIBS"
-AC_ARG_WITH(ncurses_headers, [AC_HELP_STRING(--with-ncurses-headers=dir,
- [look for ncurses.h also in dir])])
-if test -n "$with_ncurses_headers"; then
- ncurses_cppflags="-I$with_ncurses_headers"
- CPPFLAGS="$CPPFLAGS $ncurses_cppflags"
+AC_ARG_WITH(curses_headers, [AC_HELP_STRING(--with-curses-headers=dir,
+ [look for curses.h also in dir])])
+if test -n "$with_curses_headers"; then
+ curses_cppflags="-I$with_curses_headers"
+ CPPFLAGS="$CPPFLAGS $curses_cppflags"
fi
-AC_ARG_WITH(ncurses_libs, [AC_HELP_STRING(--with-ncurses-libs=dir,
- [look for libncurses also in dir])])
-if test -n "$with_ncurses_libs"; then
- ncurses_libs="-L$with_ncurses_libs"
- LDFLAGS="$LDFLAGS $ncurses_libs"
+AC_ARG_WITH(curses_libs, [AC_HELP_STRING(--with-curses-libs=dir,
+ [look for libcurses also in dir])])
+if test -n "$with_curses_libs"; then
+ curses_libs="-L$with_curses_libs"
+ LDFLAGS="$LDFLAGS $curses_libs"
fi
AC_CHECK_HEADER(curses.h, [], [
- have_ncurses="no"
+ have_curses="no"
])
-AC_CHECK_LIB([ncurses], [initscr], [], [
- have_ncurses="no"
+AC_CHECK_LIB([curses], [initscr], [], [
+ have_curses="no"
])
-if test "$have_ncurses" = "yes"; then
- AC_SUBST(ncurses_cppflags)
- AC_DEFINE(HAVE_NCURSES, 1, [define to 1 to turn on ncurses support])
+if test "$have_curses" = "yes"; then
+ AC_SUBST(curses_cppflags)
+ AC_DEFINE(HAVE_NCURSES, 1, [define to 1 to turn on curses support])
extras="$extras gui"
executables="$executables gui"
else
fi
########################################################### ogg/vorbis/speex
have_ogg="yes"
-have_vorbis="yes"
-have_speex="yes"
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LD_FLAGS="$LDFLAGS"
OLD_LIBS="$LIBS"
-AC_ARG_WITH(oggvorbis_headers, [AC_HELP_STRING(--with-oggvorbis-headers=dir,
- [look for ogg/vorbis/speex headers also in dir])])
-if test -n "$with_oggvorbis_headers"; then
- ogg_cppflags="-I$with_oggvorbis_headers"
+AC_ARG_WITH(ogg_headers, [AC_HELP_STRING(--with-ogg-headers=dir,
+ [look for ogg headers also in dir])])
+AC_ARG_WITH(ogg_libs, [AC_HELP_STRING(--with-ogg-libs=dir,
+ [look for ogg libs also in dir])])
+AC_ARG_WITH(vorbis_headers, [AC_HELP_STRING(--with-vorbis-headers=dir,
+ [look for vorbis headers also in dir])])
+AC_ARG_WITH(vorbis_libs, [AC_HELP_STRING(--with-vorbis-libs=dir,
+ [look for vorbis libs also in dir])])
+AC_ARG_WITH(speex_headers, [AC_HELP_STRING(--with-speex-headers=dir,
+ [look for speex headers also in dir])])
+AC_ARG_WITH(speex_libs, [AC_HELP_STRING(--with-speex-libs=dir,
+ [look for speex libs also in dir])])
+
+if test -n "$with_ogg_headers"; then
+ ogg_cppflags="-I$with_ogg_headers"
CPPFLAGS="$CPPFLAGS $ogg_cppflags"
fi
-AC_ARG_WITH(oggvorbis_libs, [AC_HELP_STRING(--with-oggvorbis-libs=dir,
- [look for ogg/vorbis/speex libs also in dir])])
-if test -n "$with_oggvorbis_libs"; then
- ogg_libs="-L$with_oggvorbis_libs"
+if test -n "$with_ogg_libs"; then
+ ogg_libs="-L$with_ogg_libs"
LDFLAGS="$LDFLAGS $ogg_libs"
fi
-
-AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
-AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
-AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
-AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
-AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
+AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
+
+have_vorbis="yes"
+have_speex="yes"
+if test "$have_ogg" = "yes"; then
+ # vorbis
+ if test -n "$with_vorbis_headers"; then
+ vorbis_cppflags="-I$with_vorbis_headers"
+ CPPFLAGS="$CPPFLAGS $vorbis_cppflags"
+ fi
+ if test -n "$with_vorbis_libs"; then
+ vorbis_libs="-L$with_vorbis_libs"
+ LDFLAGS="$LDFLAGS $vorbis_libs"
+ fi
+ AC_CHECK_HEADERS([vorbis/codec.h], [], [ have_vorbis="no" ])
+ AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [ have_vorbis="no" ])
+
+ # speex
+ if test -n "$with_speex_headers"; then
+ speex_cppflags="-I$with_speex_headers"
+ CPPFLAGS="$CPPFLAGS $speex_cppflags"
+ fi
+ if test -n "$with_speex_libs"; then
+ speex_libs="-L$with_speex_libs"
+ LDFLAGS="$LDFLAGS $speex_libs"
+ fi
+ AC_CHECK_LIB([speex], [speex_decoder_init], [], [ have_speex="no" ])
+ AC_CHECK_HEADERS([speex/speex.h], [], [ have_speex="no" ])
+else
+ have_vorbis="no"
+ have_speex="no"
+fi
+
msg="support in para_server/para_filter/para_afh"
-if test "$have_ogg" = "yes" && { test "$have_vorbis" = "yes" || test "$have_speex" = "yes"; }; then
+if test "$have_vorbis" = "yes" || test "$have_speex" = "yes"; then
AC_SUBST(ogg_cppflags)
ogg_libs="$ogg_libs -logg"
if test "$OSTYPE" = "Darwin"; then
- ogg_libs="-Wl,-bind_at_load $ogg_libs $ogg_libs"
+ ogg_libs="-Wl,-bind_at_load $ogg_libs"
fi
server_ldflags="$server_ldflags $ogg_libs"
filter_ldflags="$filter_ldflags $ogg_libs"
audiod_ldflags="$audiod_ldflags $ogg_libs"
- all_errlist_objs="$all_errlist_objs ogg_afh_common"
afh_ldflags="$afh_ldflags $ogg_libs"
+ all_errlist_objs="$all_errlist_objs ogg_afh_common"
afh_errlist_objs="$afh_errlist_objs ogg_afh_common"
server_errlist_objs="$server_errlist_objs ogg_afh_common"
- if test "$have_vorbis" = "yes"; then
- all_errlist_objs="$all_errlist_objs oggdec_filter ogg_afh"
- AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
- filters="$filters oggdec"
- vorbis_libs="-lvorbis -lvorbisfile"
- server_ldflags="$server_ldflags $vorbis_libs"
- filter_ldflags="$filter_ldflags $vorbis_libs"
- audiod_ldflags="$audiod_ldflags $vorbis_libs"
- afh_ldflags="$afh_ldflags $vorbis_libs"
-
- server_errlist_objs="$server_errlist_objs ogg_afh"
- filter_errlist_objs="$filter_errlist_objs oggdec_filter"
- audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
- afh_errlist_objs="$afh_errlist_objs ogg_afh"
-
- audiod_audio_formats="$audiod_audio_formats ogg"
- server_audio_formats="$server_audio_formats ogg"
- else
- AC_MSG_WARN([no ogg/vorbis $msg])
- fi
- if test "$have_speex" = "yes"; then
- all_errlist_objs="$all_errlist_objs spxdec_filter spx_afh spx_common"
- AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
- filters="$filters spxdec"
- speex_libs="-lspeex"
- server_ldflags="$server_ldflags $speex_libs"
- filter_ldflags="$filter_ldflags $speex_libs"
- audiod_ldflags="$audiod_ldflags $speex_libs"
- afh_ldflags="$afh_ldflags $speex_libs"
-
- server_errlist_objs="$server_errlist_objs spx_afh spx_common"
- filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
- audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
- afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
-
- audiod_audio_formats="$audiod_audio_formats spx"
- server_audio_formats="$server_audio_formats spx"
- else
- AC_MSG_WARN([no ogg/speex $msg])
- fi
else
- AC_MSG_WARN([no ogg/vorbis ogg/speex $msg])
+ AC_MSG_WARN([vorbis/speex require ogg])
+fi
+if test "$have_vorbis" = "yes"; then
+ all_errlist_objs="$all_errlist_objs oggdec_filter ogg_afh"
+ AC_DEFINE(HAVE_OGGVORBIS, 1, define to 1 to turn on ogg/vorbis support)
+ filters="$filters oggdec"
+ vorbis_libs="-lvorbis -lvorbisfile"
+ server_ldflags="$server_ldflags $vorbis_libs"
+ filter_ldflags="$filter_ldflags $vorbis_libs"
+ audiod_ldflags="$audiod_ldflags $vorbis_libs"
+ afh_ldflags="$afh_ldflags $vorbis_libs"
+
+ server_errlist_objs="$server_errlist_objs ogg_afh"
+ filter_errlist_objs="$filter_errlist_objs oggdec_filter"
+ audiod_errlist_objs="$audiod_errlist_objs oggdec_filter"
+ afh_errlist_objs="$afh_errlist_objs ogg_afh"
+
+ audiod_audio_formats="$audiod_audio_formats ogg"
+ server_audio_formats="$server_audio_formats ogg"
+else
+ AC_MSG_WARN([no ogg/vorbis $msg])
+fi
+if test "$have_speex" = "yes"; then
+ all_errlist_objs="$all_errlist_objs spxdec_filter spx_afh spx_common"
+ AC_DEFINE(HAVE_SPEEX, 1, define to 1 to turn on ogg/speex support)
+ filters="$filters spxdec"
+ speex_libs="-lspeex"
+ server_ldflags="$server_ldflags $speex_libs"
+ filter_ldflags="$filter_ldflags $speex_libs"
+ audiod_ldflags="$audiod_ldflags $speex_libs"
+ afh_ldflags="$afh_ldflags $speex_libs"
+
+ server_errlist_objs="$server_errlist_objs spx_afh spx_common"
+ filter_errlist_objs="$filter_errlist_objs spxdec_filter spx_common"
+ audiod_errlist_objs="$audiod_errlist_objs spxdec_filter spx_common"
+ afh_errlist_objs="$afh_errlist_objs spx_afh spx_common"
+
+ audiod_audio_formats="$audiod_audio_formats spx"
+ server_audio_formats="$server_audio_formats spx"
+else
+ AC_MSG_WARN([no ogg/speex $msg])
fi
CPPFLAGS="$OLD_CPPFLAGS"
LDFLAGS="$OLD_LDFLAGS"
#define GUI_ERRORS
#define RINGBUFFER_ERRORS
#define SCORE_ERRORS
- #define SHA1_ERRORS
#define RBTREE_ERRORS
#define RECV_ERRORS
#define IPC_ERRORS
#define AUDIOD_COMMAND_ERRORS \
PARA_ERROR(CLIENT_WRITE, "client write error"), \
- PARA_ERROR(AUDIOD_SYNTAX, "syntax error"), \
PARA_ERROR(UCRED_PERM, "permission denied"), \
PARA_ERROR(INVALID_AUDIOD_CMD, "invalid command"), \
PARA_ERROR(TOO_MANY_CLIENTS, "maximal number of stat clients exceeded"), \
#define WRITE_ERRORS \
PARA_ERROR(WRITE_SYNTAX, "para_write syntax error"), \
- PARA_ERROR(NO_WAV_HEADER, "wave header not found"), \
#define ALSA_WRITE_ERRORS \
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <stdlib.h> /* EXIT_SUCCESS */
#include "fd.h"
#include "string.h"
#include "error.h"
+#include "version.h"
INIT_FADE_ERRLISTS;
static struct fade_args_info conf;
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
#include <stdbool.h>
#include "para.h"
};
/* Grab clients that are attached to a btr node. */
-INITIALIZED_LIST_HEAD(active_grab_client_list);
+static INITIALIZED_LIST_HEAD(active_grab_client_list);
/* Grab clients that are not currently attached any btr node. */
-INITIALIZED_LIST_HEAD(inactive_grab_client_list);
+static INITIALIZED_LIST_HEAD(inactive_grab_client_list);
static int gc_write(struct grab_client *gc, char *buf, size_t len)
{
list_move(&gc->node, &active_grab_client_list);
gc->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = name, .parent = parent));
- if (!gc->task.pre_select) {
- gc->task.pre_select = gc_pre_select;
- gc->task.post_select = gc_post_select;
- snprintf(gc->task.status, sizeof(gc->task.status) - 1, "%s", name);
- gc->task.status[sizeof(gc->task.status) - 1] = '\0';
- register_task(&gc->task);
- }
+ gc->task.pre_select = gc_pre_select;
+ gc->task.post_select = gc_post_select;
+ snprintf(gc->task.status, sizeof(gc->task.status) - 1, "%s", name);
+ gc->task.status[sizeof(gc->task.status) - 1] = '\0';
+ gc->task.error = 0;
+ register_task(&gc->task);
}
/**
struct grab_client *gc, *tmp;
list_for_each_entry_safe(gc, tmp, &inactive_grab_client_list, node) {
- if (gc->task.error < 0) {
+ if (gc->fd < 0) {
list_del(&gc->node);
free(gc);
continue;
* post_select().
*/
close(gc->fd);
+ gc->fd = -1;
free(gc->parent);
free(gc->name);
return 1;
}
- gc_activate(gc);
return 0;
}
btr_consume(btrn, ret);
return;
err:
- t->error = gc_close(gc, ret)? ret : 0;
+ gc_close(gc, ret);
+ t->error = ret;
}
static int gc_check_args(int argc, char **argv, struct grab_client *gc)
#include <regex.h>
#include <signal.h>
#include <sys/types.h>
- #include <dirent.h>
#include <curses.h>
#include "gui.cmdline.h"
#include "list.h"
#include "sched.h"
#include "signal.h"
+#include "version.h"
/** define the array of error lists needed by para_gui */
INIT_GUI_ERRLISTS;
static struct win_data {
WINDOW *win;
- NCURSES_SIZE_T begx;
- NCURSES_SIZE_T begy;
- NCURSES_SIZE_T cols;
- NCURSES_SIZE_T lines;
+ size_t begx;
+ size_t begy;
+ size_t cols;
+ size_t lines;
} top, bot, sb, in, sep;
#define RINGBUFFER_SIZE 512
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
#include <stdbool.h>
#include "para.h"
#include "error.h"
#include "stdout.h"
#include "buffer_tree.h"
+#include "version.h"
/** The gengetopt args info struct. */
static struct recv_args_info conf;
*
* - Doubly linked lists: \ref list.h,
* - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h,
- * - Hashing: \ref hash.h, \ref sha1.h, \ref sha1.c,
- * - Crypto: \ref crypt.c.
+ * - Crypto: \ref crypt.c, \ref crypt.h.
* - Forward error correction: \ref fec.c.
*/
#include <signal.h>
- #include <dirent.h>
#include <sys/time.h>
- #include <openssl/rc4.h>
#include <regex.h>
#include <osl.h>
#include <stdbool.h>
#include "signal.h"
#include "user_list.h"
#include "color.h"
+#include "version.h"
/** Define the array of error lists needed by para_server. */
INIT_SERVER_ERRLISTS;
#include <regex.h>
#include <sys/types.h>
- #include <dirent.h>
#include <stdbool.h>
#include "para.h"
#include "write_common.h"
#include "fd.h"
#include "error.h"
+#include "version.h"
INIT_WRITE_ERRLISTS;