core-admin-linux: misc const/etc fixups
This commit is contained in:
parent
771be64912
commit
951e51d274
@ -30,7 +30,7 @@
|
||||
#include "qrexec.h"
|
||||
#include "libqrexec-utils.h"
|
||||
|
||||
int connect_unix_socket(char *domname)
|
||||
int connect_unix_socket(const char *domname)
|
||||
{
|
||||
int s, len;
|
||||
struct sockaddr_un remote;
|
||||
@ -51,12 +51,12 @@ int connect_unix_socket(char *domname)
|
||||
return s;
|
||||
}
|
||||
|
||||
void do_exec(char *prog)
|
||||
void do_exec(const char *prog)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -70,7 +70,7 @@ void do_exit(int code)
|
||||
}
|
||||
|
||||
|
||||
void prepare_local_fds(char *cmdline)
|
||||
void prepare_local_fds(const char *cmdline)
|
||||
{
|
||||
int pid;
|
||||
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;
|
||||
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
|
||||
// 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;
|
||||
|
||||
@ -235,7 +235,7 @@ void select_loop(int s)
|
||||
}
|
||||
}
|
||||
|
||||
void usage(char *name)
|
||||
void usage(const char *name)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: %s -d domain_num [-l local_prog] -e -c remote_cmdline\n"
|
||||
|
@ -87,7 +87,7 @@ void sigchld_handler(int x);
|
||||
|
||||
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 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
|
||||
}
|
||||
|
||||
void handle_new_client()
|
||||
void handle_new_client(void)
|
||||
{
|
||||
int fd = do_accept(qrexec_daemon_unix_socket_fd);
|
||||
if (fd >= MAX_CLIENTS) {
|
||||
@ -435,7 +435,7 @@ void sigchld_handler(int x)
|
||||
}
|
||||
|
||||
/* clean zombies, update children_count */
|
||||
void reap_children()
|
||||
void reap_children(void)
|
||||
{
|
||||
int status;
|
||||
while (waitpid(-1, &status, WNOHANG) > 0)
|
||||
@ -444,7 +444,7 @@ void reap_children()
|
||||
}
|
||||
|
||||
/* too many children - wait for one of them to terminate */
|
||||
void wait_for_child()
|
||||
void wait_for_child(void)
|
||||
{
|
||||
int status;
|
||||
waitpid(-1, &status, 0);
|
||||
@ -452,7 +452,7 @@ void wait_for_child()
|
||||
}
|
||||
|
||||
#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) {
|
||||
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.
|
||||
*/
|
||||
|
||||
void handle_execute_predefined_command()
|
||||
void handle_execute_predefined_command(void)
|
||||
{
|
||||
int i;
|
||||
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 server_header s_hdr, untrusted_s_hdr;
|
||||
|
Loading…
Reference in New Issue
Block a user