diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-06-20 20:57:25 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-06-20 20:57:25 +0200 |
commit | 16323dcc9df15020e368d4324cf1c1d9dceac805 (patch) | |
tree | c70e36289153d37f4c642b33d5003e5709d788d0 /src/lib/shm_du_map.c | |
parent | c4d614e041c693d95d1b62d3e33911b53fabf2c2 (diff) | |
download | ouroboros-16323dcc9df15020e368d4324cf1c1d9dceac805.tar.gz ouroboros-16323dcc9df15020e368d4324cf1c1d9dceac805.zip |
build: Change install directories and set correct permissions
This sets the correct install directories for all the binaries,
library and header files. It also sets the right permissions on the
sockets and shared memory so that regular users can also use the
ouroboros library. Root privileges are required to run the irmd.
Fixes #7
Diffstat (limited to 'src/lib/shm_du_map.c')
-rw-r--r-- | src/lib/shm_du_map.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/shm_du_map.c b/src/lib/shm_du_map.c index 0ce6bdcd..5f935d3f 100644 --- a/src/lib/shm_du_map.c +++ b/src/lib/shm_du_map.c @@ -21,12 +21,14 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <ouroboros/config.h> #include <ouroboros/shm_du_map.h> #include <pthread.h> #include <sys/mman.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> +#include <sys/stat.h> #define OUROBOROS_PREFIX "shm_du_map" @@ -95,6 +97,12 @@ struct shm_du_map * shm_du_map_create() return NULL; } + if (fchmod(shm_fd, 0666)) { + LOG_DBGF("Failed to chmod shared memory map."); + free(dum); + return NULL; + } + if (lseek(shm_fd, SHM_FILE_SIZE - 1, SEEK_SET) < 0) { LOG_DBGF("Failed to extend shared memory map."); free(dum); |