diff options
author | Sander Vrijders <[email protected]> | 2016-06-20 21:53:42 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-06-20 21:53:42 +0200 |
commit | 550cfa775b048abe183c4fdcc8ada8476e562185 (patch) | |
tree | aff0b0ed3474c7cdb5f6ba7e62ca5e33ccedb814 | |
parent | 4ecf8b0bfa00473e6f1c3d26693ba2491eaa84ef (diff) | |
download | ouroboros-550cfa775b048abe183c4fdcc8ada8476e562185.tar.gz ouroboros-550cfa775b048abe183c4fdcc8ada8476e562185.zip |
lib, irmd: Change sockets and shm path
Reverting from previous commit. Even when running Ouroboros sandboxed,
the sockets and shared memory should be created in the default system
paths.
-rw-r--r-- | include/ouroboros/sockets.h | 2 | ||||
-rw-r--r-- | src/irmd/main.c | 4 | ||||
-rw-r--r-- | src/lib/ipcp.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index b765b55b..0a215a76 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -36,7 +36,7 @@ typedef IrmMsg irm_msg_t; #include "ipcpd_messages.pb-c.h" typedef IpcpMsg ipcp_msg_t; -#define SOCK_PATH INSTALL_DIR "var/run/ouroboros/" +#define SOCK_PATH "/var/run/ouroboros/" #define SOCK_PATH_SUFFIX ".sock" #define IRM_SOCK_PATH SOCK_PATH "irm" SOCK_PATH_SUFFIX diff --git a/src/irmd/main.c b/src/irmd/main.c index 68789e94..5f7c1ddc 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1578,12 +1578,14 @@ static struct irm * irm_create() if (i == NULL) return NULL; - if (access(INSTALL_DIR "dev/shm/" SHM_DU_MAP_FILENAME, F_OK) != -1) { + if (access("/dev/shm/" SHM_DU_MAP_FILENAME, F_OK) != -1) { struct shm_du_map * dum = shm_du_map_open(); + if (dum == NULL) { LOG_ERR("Could not examine existing shm file."); exit(EXIT_FAILURE); } + if (kill(shm_du_map_owner(dum), 0) < 0) { LOG_INFO("IRMd didn't properly shut down last time."); shm_du_map_destroy(dum); diff --git a/src/lib/ipcp.c b/src/lib/ipcp.c index fcaf9f83..a43afd21 100644 --- a/src/lib/ipcp.c +++ b/src/lib/ipcp.c @@ -109,7 +109,7 @@ pid_t ipcp_create(char * ipcp_name, char * full_name = NULL; char * exec_name = NULL; - sprintf (irmd_pid, "%u", getpid()); + sprintf(irmd_pid, "%u", getpid()); pid = fork(); if (pid == -1) { |