summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Pepper <timothy.c.pepper@linux.intel.com>2012-09-27 17:25:39 -0700
committerTim Pepper <timothy.c.pepper@linux.intel.com>2012-09-27 17:25:39 -0700
commit40ac7b1dd6474373ceb742a5b754f6e95ec69151 (patch)
tree625e4fb44b204d19efe62f106a625927a7b142e3
parent7add2a6343ba53ca859a521037d59df98725a652 (diff)
downloadcorewatcher-40ac7b1dd6474373ceb742a5b754f6e95ec69151.tar.gz
corewatcher-40ac7b1dd6474373ceb742a5b754f6e95ec69151.tar.bz2
corewatcher-40ac7b1dd6474373ceb742a5b754f6e95ec69151.zip
Always chmod our directories.
I observed the the modes of corewatcher's directories had changed on one of my systems. I don't know what would have caused that, but it led to cores not being recorded in the filesystem. To be robust we create the directories if for some reason they do not exist at start up. Similarly, try to always insure they have the correct permissions at start up. Signed-off-by: Tim Pepper <timothy.c.pepper@linux.intel.com>
-rw-r--r--src/corewatcher.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corewatcher.c b/src/corewatcher.c
index 983d3c6..457eb1a 100644
--- a/src/corewatcher.c
+++ b/src/corewatcher.c
@@ -197,11 +197,11 @@ int main(int argc, char**argv)
dir = opendir(core_folder);
if (!dir) {
mkdir(core_folder, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
- chmod(core_folder, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
dir = opendir(core_folder);
if (!dir)
return 1;
}
+ chmod(core_folder, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
closedir(dir);
dir = opendir(processed_folder);
if (!dir) {
@@ -211,6 +211,7 @@ int main(int argc, char**argv)
if (!dir)
return 1;
}
+ chmod(processed_folder, S_IRWXU);
closedir(dir);
while (1) {