Add non-root support for UST tracing
[lttng-tools.git] / lttng-sessiond / ust-app.c
index 4f65553c8385d770c6f9c9a1e517a21e8ba0c06c..377600f3d2f2347ce52765b43c5fbec19ceddff7 100644 (file)
@@ -1160,6 +1160,7 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess,
                char *pathname, struct ust_app *app)
 {
        int ret = 0;
+       mode_t old_umask;
 
        if (ua_sess->metadata == NULL) {
                /* Allocate UST metadata */
@@ -1185,11 +1186,13 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess,
                        goto error;
                }
 
+               old_umask = umask(0);
                ret = mkdir(ua_sess->path, S_IRWXU | S_IRWXG);
                if (ret < 0) {
                        PERROR("mkdir UST metadata");
                        goto error;
                }
+               umask(old_umask);
 
                ret = snprintf(ua_sess->metadata->pathname, PATH_MAX,
                                "%s/metadata", ua_sess->path);
@@ -2195,9 +2198,6 @@ int ust_app_add_ctx_channel_glb(struct ltt_ust_session *usess,
                }
        }
 
-       /* Add ltt UST context node to ltt UST channel */
-       hashtable_add_unique(uchan->ctx, &uctx->node);
-
        rcu_read_unlock();
        return ret;
 }
@@ -2248,9 +2248,6 @@ int ust_app_add_ctx_event_glb(struct ltt_ust_session *usess,
                }
        }
 
-       /* Add ltt UST context node to ltt UST event */
-       hashtable_add_unique(uevent->ctx, &uctx->node);
-
        rcu_read_unlock();
        return ret;
 }
This page took 0.02365 seconds and 4 git commands to generate.