Always use 022 as the umask when creating the rootfs directory and
executing the template. A too loose umask may cause security issues.
A too strict umask may cause programs to fail inside the container.
Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
int flags, char *const argv[])
{
int partial_fd;
+ mode_t mask;
pid_t pid;
bool ret = false;
char *tpath = NULL;
/* No need to get disk lock bc we have the partial lock. */
+ mask = umask(0022);
+
/* Create the storage.
* Note we can't do this in the same task as we use to execute the
* template because of the way zfs works.
ret = load_config_locked(c, c->configfile);
out_unlock:
+ umask(mask);
if (partial_fd >= 0)
remove_partial(c, partial_fd);
out: