core-admin-linux: misc const/etc fixups

This commit is contained in:
Vincent Penquerc'h 2013-12-30 06:36:36 -05:00 committed by Marek Marczykowski-Górecki
parent 771be64912
commit 951e51d274
2 changed files with 14 additions and 14 deletions

View File

@ -30,7 +30,7 @@
#include "qrexec.h" #include "qrexec.h"
#include "libqrexec-utils.h" #include "libqrexec-utils.h"
int connect_unix_socket(char *domname) int connect_unix_socket(const char *domname)
{ {
int s, len; int s, len;
struct sockaddr_un remote; struct sockaddr_un remote;
@ -51,12 +51,12 @@ int connect_unix_socket(char *domname)
return s; return s;
} }
void do_exec(char *prog) void do_exec(const char *prog)
{ {
execl("/bin/bash", "bash", "-c", prog, NULL); execl("/bin/bash", "bash", "-c", prog, NULL);
} }
int local_stdin_fd, local_stdout_fd; static int local_stdin_fd, local_stdout_fd;
void do_exit(int code) void do_exit(int code)
{ {
@ -70,7 +70,7 @@ void do_exit(int code)
} }
void prepare_local_fds(char *cmdline) void prepare_local_fds(const char *cmdline)
{ {
int pid; int pid;
if (!cmdline) { if (!cmdline) {
@ -83,7 +83,7 @@ void prepare_local_fds(char *cmdline)
} }
void send_cmdline(int s, int type, char *cmdline) void send_cmdline(int s, int type, const char *cmdline)
{ {
struct client_header hdr; struct client_header hdr;
hdr.type = type; hdr.type = type;
@ -190,7 +190,7 @@ void handle_daemon_data(int s)
// perhaps we could save a syscall if we include both sides in both // perhaps we could save a syscall if we include both sides in both
// rdset and wrset; to be investigated // rdset and wrset; to be investigated
void handle_daemon_only_until_writable(s) void handle_daemon_only_until_writable(int s)
{ {
fd_set rdset, wrset; fd_set rdset, wrset;
@ -235,7 +235,7 @@ void select_loop(int s)
} }
} }
void usage(char *name) void usage(const char *name)
{ {
fprintf(stderr, fprintf(stderr,
"usage: %s -d domain_num [-l local_prog] -e -c remote_cmdline\n" "usage: %s -d domain_num [-l local_prog] -e -c remote_cmdline\n"

View File

@ -87,7 +87,7 @@ void sigchld_handler(int x);
char *remote_domain_name; // guess what char *remote_domain_name; // guess what
int create_qrexec_socket(int domid, char *domname) int create_qrexec_socket(int domid, const char *domname)
{ {
char socket_address[40]; char socket_address[40];
char link_to_socket_name[strlen(domname) + sizeof(socket_address)]; char link_to_socket_name[strlen(domname) + sizeof(socket_address)];
@ -222,7 +222,7 @@ void init(int xid)
kill(getppid(), SIGUSR1); // let the parent know we are ready kill(getppid(), SIGUSR1); // let the parent know we are ready
} }
void handle_new_client() void handle_new_client(void)
{ {
int fd = do_accept(qrexec_daemon_unix_socket_fd); int fd = do_accept(qrexec_daemon_unix_socket_fd);
if (fd >= MAX_CLIENTS) { if (fd >= MAX_CLIENTS) {
@ -435,7 +435,7 @@ void sigchld_handler(int x)
} }
/* clean zombies, update children_count */ /* clean zombies, update children_count */
void reap_children() void reap_children(void)
{ {
int status; int status;
while (waitpid(-1, &status, WNOHANG) > 0) while (waitpid(-1, &status, WNOHANG) > 0)
@ -444,7 +444,7 @@ void reap_children()
} }
/* too many children - wait for one of them to terminate */ /* too many children - wait for one of them to terminate */
void wait_for_child() void wait_for_child(void)
{ {
int status; int status;
waitpid(-1, &status, 0); waitpid(-1, &status, 0);
@ -452,7 +452,7 @@ void wait_for_child()
} }
#define MAX_CHILDREN 10 #define MAX_CHILDREN 10
void check_children_count_and_wait_if_too_many() void check_children_count_and_wait_if_too_many(void)
{ {
if (children_count > MAX_CHILDREN) { if (children_count > MAX_CHILDREN) {
fprintf(stderr, fprintf(stderr,
@ -487,7 +487,7 @@ void sanitize_name(char * untrusted_s_signed)
Called when agent sends a message asking to execute a predefined command. Called when agent sends a message asking to execute a predefined command.
*/ */
void handle_execute_predefined_command() void handle_execute_predefined_command(void)
{ {
int i; int i;
struct trigger_connect_params untrusted_params, params; struct trigger_connect_params untrusted_params, params;
@ -564,7 +564,7 @@ void sanitize_message_from_agent(struct server_header *untrusted_header)
} }
} }
void handle_message_from_agent() void handle_message_from_agent(void)
{ {
struct client_header hdr; struct client_header hdr;
struct server_header s_hdr, untrusted_s_hdr; struct server_header s_hdr, untrusted_s_hdr;