projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: fix: strncpy called with source length
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index f7b3c7c84d1add69c1114e89f81ac4911490b33d..d559306cb323a7578d62058063777d2a07466d21 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-2436,7
+2436,8
@@
static pid_t spawn_consumerd(struct consumer_data *consumer_data)
} else if (stat(INSTALL_BIN_PATH "/" DEFAULT_CONSUMERD_FILE, &st) == 0) {
DBG3("Found location #2");
consumer_to_use = INSTALL_BIN_PATH "/" DEFAULT_CONSUMERD_FILE;
} else if (stat(INSTALL_BIN_PATH "/" DEFAULT_CONSUMERD_FILE, &st) == 0) {
DBG3("Found location #2");
consumer_to_use = INSTALL_BIN_PATH "/" DEFAULT_CONSUMERD_FILE;
- } else if (stat(config.consumerd32_bin_path.value, &st) == 0) {
+ } else if (config.consumerd32_bin_path.value &&
+ stat(config.consumerd32_bin_path.value, &st) == 0) {
DBG3("Found location #3");
consumer_to_use = config.consumerd32_bin_path.value;
} else {
DBG3("Found location #3");
consumer_to_use = config.consumerd32_bin_path.value;
} else {
@@
-2651,6
+2652,12
@@
static int init_kernel_tracer(void)
}
DBG("Kernel tracer fd %d", kernel_tracer_fd);
}
DBG("Kernel tracer fd %d", kernel_tracer_fd);
+
+ ret = syscall_init_table();
+ if (ret < 0) {
+ ERR("Unable to populate syscall table. Syscall tracing won't "
+ "work for this session daemon.");
+ }
return 0;
error_version:
return 0;
error_version:
@@
-4110,9
+4117,17
@@
static void *thread_manage_health(void *data)
}
if (is_root) {
}
if (is_root) {
+ gid_t gid;
+
/* lttng health client socket path permissions */
/* lttng health client socket path permissions */
+ ret = utils_get_group_id(config.tracing_group_name.value, true,
+ &gid);
+ if (ret) {
+ /* Default to root group. */
+ gid = 0;
+ }
ret = chown(config.health_unix_sock_path.value, 0,
ret = chown(config.health_unix_sock_path.value, 0,
-
utils_get_group_id(config.tracing_group_name.value)
);
+
gid
);
if (ret < 0) {
ERR("Unable to set group on %s", config.health_unix_sock_path.value);
PERROR("chown");
if (ret < 0) {
ERR("Unable to set group on %s", config.health_unix_sock_path.value);
PERROR("chown");
@@
-5237,7
+5252,11
@@
static int set_permissions(char *rundir)
int ret;
gid_t gid;
int ret;
gid_t gid;
- gid = utils_get_group_id(config.tracing_group_name.value);
+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid);
+ if (ret) {
+ /* Default to root group. */
+ gid = 0;
+ }
/* Set lttng run dir */
ret = chown(rundir, 0, gid);
/* Set lttng run dir */
ret = chown(rundir, 0, gid);
@@
-5348,7
+5367,16
@@
static int set_consumer_sockets(struct consumer_data *consumer_data)
goto error;
}
if (is_root) {
goto error;
}
if (is_root) {
- ret = chown(path, 0, utils_get_group_id(config.tracing_group_name.value));
+ gid_t gid;
+
+ ret = utils_get_group_id(config.tracing_group_name.value, true,
+ &gid);
+ if (ret) {
+ /* Default to root group. */
+ gid = 0;
+ }
+
+ ret = chown(path, 0, gid);
if (ret < 0) {
ERR("Unable to set group on %s", path);
PERROR("chown");
if (ret < 0) {
ERR("Unable to set group on %s", path);
PERROR("chown");
@@
-5749,14
+5777,6
@@
int main(int argc, char **argv)
/* Setup kernel tracer */
if (!config.no_kernel) {
init_kernel_tracer();
/* Setup kernel tracer */
if (!config.no_kernel) {
init_kernel_tracer();
- if (kernel_tracer_fd >= 0) {
- ret = syscall_init_table();
- if (ret < 0) {
- ERR("Unable to populate syscall table. "
- "Syscall tracing won't work "
- "for this session daemon.");
- }
- }
}
/* Set ulimit for open files */
}
/* Set ulimit for open files */
This page took
0.029036 seconds
and
4
git commands to generate.