projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement run_as wrappers for mkdir/mkdir_recursive/open
[lttng-tools.git]
/
lttng-sessiond
/
ust-app.c
diff --git
a/lttng-sessiond/ust-app.c
b/lttng-sessiond/ust-app.c
index 77dcc71a6fee77bbcc28d1298eb90355566fb630..09989ff49ea7af21f1cb116d62923e193043e2cb 100644
(file)
--- a/
lttng-sessiond/ust-app.c
+++ b/
lttng-sessiond/ust-app.c
@@
-34,6
+34,7
@@
#include "ust-app.h"
#include "ust-consumer.h"
#include "ust-ctl.h"
#include "ust-app.h"
#include "ust-consumer.h"
#include "ust-ctl.h"
+#include "utils.h"
/*
* Delete ust context safely. RCU read lock must be held before calling
/*
* Delete ust context safely. RCU read lock must be held before calling
@@
-1167,7
+1168,6
@@
static int create_ust_app_metadata(struct ust_app_session *ua_sess,
char *pathname, struct ust_app *app)
{
int ret = 0;
char *pathname, struct ust_app *app)
{
int ret = 0;
- mode_t old_umask;
if (ua_sess->metadata == NULL) {
/* Allocate UST metadata */
if (ua_sess->metadata == NULL) {
/* Allocate UST metadata */
@@
-1193,18
+1193,12
@@
static int create_ust_app_metadata(struct ust_app_session *ua_sess,
goto error;
}
goto error;
}
- old_umask = umask(0);
-
ret = mkdir(ua_sess->path, S_IRWXU | S_IRWXG
);
+ ret = mkdir_run_as(ua_sess->path, S_IRWXU | S_IRWXG,
+
ua_sess->uid, ua_sess->gid
);
if (ret < 0) {
PERROR("mkdir UST metadata");
goto error;
}
if (ret < 0) {
PERROR("mkdir UST metadata");
goto error;
}
- ret = chown(ua_sess->path, ua_sess->uid, ua_sess->gid);
- if (ret < 0) {
- ERR("Unable to change owner of %s", ua_sess->path);
- perror("chown");
- }
- umask(old_umask);
ret = snprintf(ua_sess->metadata->pathname, PATH_MAX,
"%s/metadata", ua_sess->path);
ret = snprintf(ua_sess->metadata->pathname, PATH_MAX,
"%s/metadata", ua_sess->path);
This page took
0.02387 seconds
and
4
git commands to generate.