#include <stdio.h>#include <stdint.h>#include <stdbool.h>#include <stdlib.h>#include <string.h>#include <signal.h>#include <sys/socket.h>#include <bits/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 "report.h"#include "protocol.h"#include "invokelib.h"#include "search.h"Go to the source code of this file.
Defines | |
| #define | _GNU_SOURCE |
Enumerations | |
| enum | APP_TYPE { M_APP, QT_APP, QDECL_APP, EXEC_APP, UNKNOWN_APP } |
Functions | |
| static void | sigs_restore (void) |
| static void | sigs_init (void) |
| static void | sig_forwarder (int sig) |
| static void | sigs_set (struct sigaction *sig) |
| static void | show_credentials (void) |
| static bool | invoke_recv_ack (int fd) |
| static int | invoker_init (enum APP_TYPE app_type) |
| 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, char *name) |
| static void | invoker_send_splash_file (int fd, char *filename) |
| static void | invoker_send_landscape_splash_file (int fd, char *filename) |
| 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 int | wait_for_launched_process_to_exit (int socket_fd, bool wait_term) |
| static int | invoke_remote (int socket_fd, int prog_argc, char **prog_argv, char *prog_name, uint32_t magic_options, bool wait_term, unsigned int respawn_delay, char *splash_file, char *landscape_splash_file) |
| static void | invoke_fallback (char **prog_argv, char *prog_name, bool wait_term) |
| static int | invoke (int prog_argc, char **prog_argv, char *prog_name, enum APP_TYPE app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay, char *splash_file, char *landscape_splash_file) |
| 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 = 3 |
| static const unsigned int | MIN_RESPAWN_DELAY = 0 |
| static const unsigned int | MAX_RESPAWN_DELAY = 10 |
| static const unsigned char | EXIT_STATUS_APPLICATION_CONNECTION_LOST = 0xfa |
| 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] |
| Pipe used to safely catch Unix signals. | |
| enum APP_TYPE |
| static unsigned int get_delay | ( | char * | delay_arg, | |
| char * | param_name, | |||
| unsigned int | min_value, | |||
| unsigned int | max_value | |||
| ) | [static] |
| static int invoke | ( | int | prog_argc, | |
| char ** | prog_argv, | |||
| char * | prog_name, | |||
| enum APP_TYPE | app_type, | |||
| uint32_t | magic_options, | |||
| bool | wait_term, | |||
| unsigned int | respawn_delay, | |||
| char * | splash_file, | |||
| char * | landscape_splash_file | |||
| ) | [static] |
Definition at line 657 of file invoker.c.
References invoke_fallback(), invoke_remote(), and invoker_init().
| static void invoke_fallback | ( | char ** | prog_argv, | |
| char * | prog_name, | |||
| bool | wait_term | |||
| ) | [static] |
| static bool invoke_recv_ack | ( | int | fd | ) | [static] |
| static int invoke_remote | ( | int | socket_fd, | |
| int | prog_argc, | |||
| char ** | prog_argv, | |||
| char * | prog_name, | |||
| uint32_t | magic_options, | |||
| bool | wait_term, | |||
| unsigned int | respawn_delay, | |||
| char * | splash_file, | |||
| char * | landscape_splash_file | |||
| ) | [static] |
Definition at line 588 of file invoker.c.
References invoker_send_args(), invoker_send_delay(), invoker_send_end(), invoker_send_env(), invoker_send_exec(), invoker_send_ids(), invoker_send_io(), invoker_send_landscape_splash_file(), invoker_send_magic(), invoker_send_name(), invoker_send_prio(), invoker_send_splash_file(), and wait_for_launched_process_to_exit().
| static int invoker_init | ( | enum APP_TYPE | app_type | ) | [static] |
Definition at line 221 of file invoker.c.
References EXEC_APP, INVOKER_EXEC_SOCK, INVOKER_M_SOCK, INVOKER_QDECL_SOCK, INVOKER_QT_SOCK, M_APP, QDECL_APP, and QT_APP.
| static bool invoker_recv_exit | ( | int | fd, | |
| int * | status | |||
| ) | [static] |
| static uint32_t invoker_recv_pid | ( | int | fd | ) | [static] |
| static void invoker_send_args | ( | int | fd, | |
| int | argc, | |||
| char ** | argv | |||
| ) | [static] |
| static void invoker_send_delay | ( | int | fd, | |
| int | delay | |||
| ) | [static] |
| static void invoker_send_end | ( | int | fd | ) | [static] |
| static void invoker_send_env | ( | int | fd | ) | [static] |
Definition at line 379 of file invoker.c.
References environ, invoke_send_msg(), and invoke_send_str().
| static void invoker_send_exec | ( | int | fd, | |
| char * | exec | |||
| ) | [static] |
| static void invoker_send_ids | ( | int | fd, | |
| int | uid, | |||
| int | gid | |||
| ) | [static] |
| static void invoker_send_io | ( | int | fd | ) | [static] |
| static void invoker_send_landscape_splash_file | ( | int | fd, | |
| char * | filename | |||
| ) | [static] |
| static void invoker_send_magic | ( | int | fd, | |
| uint32_t | options | |||
| ) | [static] |
| static void invoker_send_name | ( | int | fd, | |
| char * | name | |||
| ) | [static] |
| static void invoker_send_prio | ( | int | fd, | |
| int | prio | |||
| ) | [static] |
| static void invoker_send_splash_file | ( | int | fd, | |
| char * | filename | |||
| ) | [static] |
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 685 of file invoker.c.
References EXEC_APP, EXIT_DELAY, EXIT_STATUS_APPLICATION_NOT_FOUND, g_signal_pipe, get_delay(), invoke(), M_APP, MAX_EXIT_DELAY, MAX_RESPAWN_DELAY, MIN_EXIT_DELAY, MIN_RESPAWN_DELAY, QDECL_APP, QT_APP, RESPAWN_DELAY, search_program(), show_credentials(), UNKNOWN_APP, and usage().
| static void sig_forwarder | ( | int | sig | ) | [static] |
Definition at line 86 of file invoker.c.
References g_invoked_pid, g_signal_pipe, and sigs_restore().
| static void sigs_init | ( | void | ) | [static] |
| static void sigs_restore | ( | void | ) | [static] |
| static void usage | ( | int | status | ) | [static] |
Definition at line 444 of file invoker.c.
References EXIT_DELAY, MAX_RESPAWN_DELAY, and RESPAWN_DELAY.
| static int wait_for_launched_process_to_exit | ( | int | socket_fd, | |
| bool | wait_term | |||
| ) | [static] |
Definition at line 507 of file invoker.c.
References g_invoked_pid, g_signal_pipe, invoker_recv_exit(), invoker_recv_pid(), sigs_init(), and sigs_restore().
| char** environ |
const unsigned int EXIT_DELAY = 0 [static] |
const unsigned char EXIT_STATUS_APPLICATION_CONNECTION_LOST = 0xfa [static] |
const unsigned char EXIT_STATUS_APPLICATION_NOT_FOUND = 0x7f [static] |
pid_t g_invoked_pid = -1 [static] |
int g_signal_pipe[2] [static] |
const unsigned int MAX_EXIT_DELAY = 86400 [static] |
const unsigned int MAX_RESPAWN_DELAY = 10 [static] |
const unsigned int MIN_EXIT_DELAY = 1 [static] |
const unsigned int MIN_RESPAWN_DELAY = 0 [static] |
const unsigned int RESPAWN_DELAY = 3 [static] |
1.5.6