summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--snac.c9
-rw-r--r--snac.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/snac.c b/snac.c
index 7fbb61e..b35e645 100644
--- a/snac.c
+++ b/snac.c
@@ -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}
diff --git a/snac.h b/snac.h
index 72da95d..f19f7e1 100644
--- a/snac.h
+++ b/snac.h
@@ -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