mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Fixed failed mkdir() in restricted environments.
This commit is contained in:
parent
c562a4531c
commit
d2aa5727ba
9
snac.c
9
snac.c
@ -35,8 +35,13 @@ int mkdirx(const char *pathname)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = mkdir(pathname, DIR_PERM)) != -1)
|
||||
ret = chmod(pathname, DIR_PERM);
|
||||
if ((ret = mkdir(pathname, DIR_PERM)) != -1) {
|
||||
/* try to the set the setgid bit, to allow system users
|
||||
to create files in these directories using the
|
||||
command-line tool. This may fail in some restricted
|
||||
environments, but it's of no use there anyway */
|
||||
chmod(pathname, DIR_PERM_ADD);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user