Add non-root support for UST tracing
[lttng-tools.git] / lttng-sessiond / ust-app.c
index 2ed9d002d49f444df38662f3cf26e335d10f0b41..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);
This page took 0.024266 seconds and 4 git commands to generate.