mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Ensure the setgid bit is set in the base directory.
This commit is contained in:
parent
fabe6a5006
commit
392c5147a3
1 changed files with 4 additions and 1 deletions
5
utils.c
5
utils.c
|
@ -143,11 +143,14 @@ int snac_init(const char *basedir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mkdir(srv_basedir, 0775) == -1) {
|
if (mkdir(srv_basedir, DIR_PERM) == -1) {
|
||||||
printf("ERROR: cannot create directory '%s'\n", srv_basedir);
|
printf("ERROR: cannot create directory '%s'\n", srv_basedir);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* force permissions (mkdir also uses 777) */
|
||||||
|
chmod(srv_basedir, DIR_PERM);
|
||||||
|
|
||||||
xs *udir = xs_fmt("%s/user", srv_basedir);
|
xs *udir = xs_fmt("%s/user", srv_basedir);
|
||||||
mkdir(udir, DIR_PERM);
|
mkdir(udir, DIR_PERM);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue