X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=librunas%2Frunas.c;h=f612ccc7554590a44fdeca167a33f29d4b0ee0d0;hb=10d32e930a6b67c3f196ca3bf4f247d444d8c2b6;hp=0ffe52ea3792ad8f9e0e6a4d8933bff13c96d998;hpb=6da9f915f29c93ac54ed62e7669df7c7e18a141d;p=lttng-tools.git diff --git a/librunas/runas.c b/librunas/runas.c index 0ffe52ea3..f612ccc75 100644 --- a/librunas/runas.c +++ b/librunas/runas.c @@ -230,7 +230,7 @@ int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid) * where the stack grows up (HPPA). */ pid = clone(child_run_as, child_stack + (CHILD_STACK_SIZE / 2), - CLONE_FILES | SIGCHLD, + CLONE_FILES | SIGCHLD | CLONE_VM, &run_as_data, NULL); if (pid < 0) { perror("clone"); @@ -255,7 +255,7 @@ int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid) * Parent: wait for child to return, in which case the * shared memory map will have been created. */ - pid = wait(&status); + pid = waitpid(pid, &status, 0); if (pid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { perror("wait"); ret = -1; @@ -302,6 +302,8 @@ int open_run_as(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid) { struct open_data data; + DBG3("open() %s with flags %X mode %d for uid %d and gid %d", + path, flags, mode, uid, gid); data.path = path; data.flags = flags; data.mode = mode;