diff options
| -rw-r--r-- | snac.c | 9 | ||||
| -rw-r--r-- | snac.h | 3 |
2 files changed, 9 insertions, 3 deletions
| @@ -35,8 +35,13 @@ int mkdirx(const char *pathname) | |||
| 35 | { | 35 | { |
| 36 | int ret; | 36 | int ret; |
| 37 | 37 | ||
| 38 | if ((ret = mkdir(pathname, DIR_PERM)) != -1) | 38 | if ((ret = mkdir(pathname, DIR_PERM)) != -1) { |
| 39 | ret = chmod(pathname, DIR_PERM); | 39 | /* try to the set the setgid bit, to allow system users |
| 40 | to create files in these directories using the | ||
| 41 | command-line tool. This may fail in some restricted | ||
| 42 | environments, but it's of no use there anyway */ | ||
| 43 | chmod(pathname, DIR_PERM_ADD); | ||
| 44 | } | ||
| 40 | 45 | ||
| 41 | return ret; | 46 | return ret; |
| 42 | } | 47 | } |
| @@ -7,7 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | #define WHAT_IS_SNAC_URL "https:/" "/comam.es/what-is-snac" | 8 | #define WHAT_IS_SNAC_URL "https:/" "/comam.es/what-is-snac" |
| 9 | 9 | ||
| 10 | #define DIR_PERM 02770 | 10 | #define DIR_PERM 00770 |
| 11 | #define DIR_PERM_ADD 02770 | ||
| 11 | 12 | ||
| 12 | #define ISO_DATE_SPEC "%Y-%m-%dT%H:%M:%SZ" | 13 | #define ISO_DATE_SPEC "%Y-%m-%dT%H:%M:%SZ" |
| 13 | 14 | ||