mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 10:21:55 +00:00
Merge pull request #2279 from kunkku/create-umask
do_lxcapi_create: set umask
This commit is contained in:
commit
ad38dca193
@ -1698,6 +1698,7 @@ static bool do_lxcapi_create(struct lxc_container *c, const char *t,
|
|||||||
int flags, char *const argv[])
|
int flags, char *const argv[])
|
||||||
{
|
{
|
||||||
int partial_fd;
|
int partial_fd;
|
||||||
|
mode_t mask;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
char *tpath = NULL;
|
char *tpath = NULL;
|
||||||
@ -1770,6 +1771,8 @@ static bool do_lxcapi_create(struct lxc_container *c, const char *t,
|
|||||||
|
|
||||||
/* No need to get disk lock bc we have the partial lock. */
|
/* No need to get disk lock bc we have the partial lock. */
|
||||||
|
|
||||||
|
mask = umask(0022);
|
||||||
|
|
||||||
/* Create the storage.
|
/* Create the storage.
|
||||||
* Note we can't do this in the same task as we use to execute the
|
* Note we can't do this in the same task as we use to execute the
|
||||||
* template because of the way zfs works.
|
* template because of the way zfs works.
|
||||||
@ -1830,6 +1833,7 @@ static bool do_lxcapi_create(struct lxc_container *c, const char *t,
|
|||||||
ret = load_config_locked(c, c->configfile);
|
ret = load_config_locked(c, c->configfile);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
umask(mask);
|
||||||
if (partial_fd >= 0)
|
if (partial_fd >= 0)
|
||||||
remove_partial(c, partial_fd);
|
remove_partial(c, partial_fd);
|
||||||
out:
|
out:
|
||||||
|
Loading…
Reference in New Issue
Block a user