Fixed segfaulting access control, allowed change to acl via control socket.

This commit is contained in:
Matthew Bloch
2012-05-19 12:48:03 +01:00
parent 580b821f61
commit 8a38cf48eb
8 changed files with 257 additions and 104 deletions

View File

@@ -4,27 +4,14 @@
#define _GNU_SOURCE
#define _LARGEFILE64_SOURCE
#include "parse.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
union mysockaddr {
unsigned short family;
struct sockaddr generic;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
};
struct ip_and_mask {
union mysockaddr ip;
int mask;
};
struct mode_serve_params {
union mysockaddr bind_to;
int acl_entries;
struct ip_and_mask** acl;
struct ip_and_mask *acl[0];
char* filename;
int tcp_backlog;
char* control_socket_name;
@@ -54,6 +41,11 @@ struct client_params {
char* block_allocation_map;
};
struct control_params {
int socket;
struct mode_serve_params* serve;
};
union mode_params {
struct mode_serve_params serve;
struct mode_readwrite_params readwrite;