applauncherd
|
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <sys/wait.h>
#include <limits.h>
#include <getopt.h>
#include <fcntl.h>
#include <time.h>
#include <poll.h>
#include <dbus/dbus.h>
#include "report.h"
#include "protocol.h"
#include "invokelib.h"
#include "search.h"
#include "sailjail.h"
Go to the source code of this file.
Classes | |
struct | InvokeArgs |
Macros | |
#define | _GNU_SOURCE |
#define | BOOSTER_SESSION "silica-session" |
#define | BOOSTER_GENERIC "generic" |
#define | UNDEFINED_APPLICATION "default" |
#define | VERBOSE_SIGNALS 0 |
#define | INVOKE_ARGS_INIT |
Typedefs | |
typedef struct InvokeArgs | InvokeArgs |
Functions | |
static char * | strip (char *str) |
static char * | slice (const char *pos, const char **ppos, const char *delim) |
static char ** | split (const char *str, const char *delim) |
static void | sigs_restore (void) |
static void | sigs_init (void) |
static void | sig_forwarder (int sig) |
static void | sigs_set (struct sigaction *sig) |
static unsigned | timestamp (void) |
static bool | shutdown_socket (int socket_fd) |
static void | kill_application (pid_t pid) |
static bool | invoke_recv_ack (int fd) |
static int | invoker_init (const char *app_type, const char *app_name) |
static uint32_t | invoker_recv_pid (int fd) |
static bool | invoker_recv_exit (int fd, int *status) |
static void | invoker_send_magic (int fd, uint32_t options) |
static void | invoker_send_name (int fd, const char *name) |
static void | invoker_send_exec (int fd, char *exec) |
static void | invoker_send_args (int fd, int argc, char **argv) |
static void | invoker_send_prio (int fd, int prio) |
static void | invoker_send_delay (int fd, int delay) |
static void | invoker_send_ids (int fd, int uid, int gid) |
static void | invoker_send_env (int fd) |
static void | invoker_send_io (int fd) |
static void | invoker_send_end (int fd) |
static void | usage (int status) |
static unsigned int | get_delay (char *delay_arg, char *param_name, unsigned int min_value, unsigned int max_value) |
static void | notify_app_launch (const char *desktop_file) |
static bool | ask_for_sandboxing (const char *app) |
static int | wait_for_launched_process_to_exit (int socket_fd) |
static int | invoke_remote (int socket_fd, const InvokeArgs *args) |
static void | invoke_fallback (const InvokeArgs *args) |
static int | invoke (InvokeArgs *args) |
int | main (int argc, char *argv[]) |
Variables | |
static const unsigned int | EXIT_DELAY = 0 |
static const unsigned int | MIN_EXIT_DELAY = 1 |
static const unsigned int | MAX_EXIT_DELAY = 86400 |
static const unsigned int | RESPAWN_DELAY = 1 |
static const unsigned int | MIN_RESPAWN_DELAY = 0 |
static const unsigned int | MAX_RESPAWN_DELAY = 10 |
static const unsigned char | EXIT_STATUS_APPLICATION_NOT_FOUND = 0x7f |
char ** | environ |
static pid_t | g_invoked_pid = -1 |
static int | g_signal_pipe [2] = { -1, -1 } |
Pipe used to safely catch Unix signals. | |
#define INVOKE_ARGS_INIT |
typedef struct InvokeArgs InvokeArgs |
|
static |
Definition at line 627 of file invoker.c.
References EXIT_DELAY, and usage().
|
static |
Definition at line 869 of file invoker.c.
References InvokeArgs::app_name, InvokeArgs::app_type, BOOSTER_GENERIC, BOOSTER_SESSION, invoke_fallback(), invoke_remote(), invoker_init(), split(), and UNDEFINED_APPLICATION.
|
static |
Definition at line 838 of file invoker.c.
References environ, InvokeArgs::prog_argv, InvokeArgs::prog_name, and InvokeArgs::wait_term.
|
static |
Definition at line 335 of file invoker.c.
References invoke_recv_msg().
|
static |
Definition at line 797 of file invoker.c.
References InvokeArgs::desktop_file, invoker_send_args(), invoker_send_delay(), invoker_send_end(), invoker_send_env(), invoker_send_exec(), invoker_send_ids(), invoker_send_io(), invoker_send_magic(), invoker_send_name(), invoker_send_prio(), InvokeArgs::magic_options, notify_app_launch(), InvokeArgs::prog_argc, InvokeArgs::prog_argv, InvokeArgs::prog_name, InvokeArgs::respawn_delay, wait_for_launched_process_to_exit(), and InvokeArgs::wait_term.
|
static |
|
static |
Definition at line 432 of file invoker.c.
References invoke_recv_msg().
|
static |
Definition at line 414 of file invoker.c.
References invoke_recv_msg().
|
static |
Definition at line 475 of file invoker.c.
References invoke_send_msg(), and invoke_send_str().
|
static |
Definition at line 495 of file invoker.c.
References invoke_send_msg().
|
static |
Definition at line 567 of file invoker.c.
References invoke_recv_ack(), and invoke_send_msg().
|
static |
Definition at line 510 of file invoker.c.
References environ, invoke_send_msg(), and invoke_send_str().
|
static |
Definition at line 469 of file invoker.c.
References invoke_send_msg(), and invoke_send_str().
|
static |
Definition at line 502 of file invoker.c.
References invoke_send_msg().
|
static |
Definition at line 529 of file invoker.c.
References invoke_send_msg().
|
static |
Definition at line 456 of file invoker.c.
References invoke_send_msg().
|
static |
Definition at line 463 of file invoker.c.
References invoke_send_msg(), and invoke_send_str().
|
static |
Definition at line 488 of file invoker.c.
References invoke_send_msg().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 941 of file invoker.c.
References InvokeArgs::app_name, InvokeArgs::app_type, ask_for_sandboxing(), BOOSTER_GENERIC, InvokeArgs::desktop_file, InvokeArgs::exit_delay, EXIT_STATUS_APPLICATION_NOT_FOUND, g_signal_pipe, get_delay(), invoke(), INVOKE_ARGS_INIT, InvokeArgs::magic_options, MAX_EXIT_DELAY, MAX_RESPAWN_DELAY, MIN_EXIT_DELAY, MIN_RESPAWN_DELAY, InvokeArgs::prog_argc, InvokeArgs::prog_argv, InvokeArgs::prog_name, InvokeArgs::respawn_delay, InvokeArgs::sandboxing_id, search_program(), InvokeArgs::test_mode, TEST_MODE_CONTROL_FILE, UNDEFINED_APPLICATION, usage(), and InvokeArgs::wait_term.
|
static |
|
static |
Definition at line 226 of file invoker.c.
References timestamp().
|
static |
Definition at line 158 of file invoker.c.
References g_signal_pipe.
|
static |
Definition at line 186 of file invoker.c.
References sig_forwarder(), and sigs_set().
|
static |
Definition at line 198 of file invoker.c.
References sigs_set().
|
static |
|
static |
|
static |
Definition at line 575 of file invoker.c.
References EXIT_DELAY, MAX_RESPAWN_DELAY, and RESPAWN_DELAY.
|
static |
Definition at line 682 of file invoker.c.
References g_invoked_pid, g_signal_pipe, invoker_recv_exit(), invoker_recv_pid(), kill_application(), shutdown_socket(), sigs_init(), and sigs_restore().
|
extern |
|
static |
|
static |