The run_as_mkdirat() function returns the _errno value returned
by the run-as worker instead of returning `ret`. This causes
run_as_mkdirat() to return an error when errno was already set
to a non-zero value by a previous libc/system call.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
run_as(dirfd == AT_FDCWD ? RUN_AS_MKDIR : RUN_AS_MKDIRAT,
&data, &run_as_ret, uid, gid);
errno = run_as_ret._errno;
- ret = run_as_ret._errno;
+ ret = run_as_ret.u.mkdirat.ret;
error:
return ret;
}