freebsd: fchmod is not supported on posix shm
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Feb 2012 00:44:56 +0000 (19:44 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Feb 2012 00:44:56 +0000 (19:44 -0500)
It is OK not to the the fchmod. However, if UST apps start before
lttng-sessiond, they will have write access to the futex shm.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng-sessiond/shm.c

index 77c09995cf194d41620317c90e4ce6b961b8b1af..55d00e67fdd1cf443ac82c4160be3a003d6f0b18 100644 (file)
@@ -104,11 +104,15 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global)
                exit(EXIT_FAILURE);
        }
 
+#ifndef __FreeBSD__
        ret = fchmod(wait_shm_fd, mode);
        if (ret < 0) {
                perror("fchmod");
                exit(EXIT_FAILURE);
        }
+#else
+#warning "FreeBSD does not support setting file mode on shm FD. Remember that for secure use, lttng-sessiond should be started before applications linked on lttng-ust."
+#endif
 
        DBG("Got the wait shm fd %d", wait_shm_fd);
 
This page took 0.026375 seconds and 4 git commands to generate.