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>
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) {
if (!dir)
return 1;
}
+ chmod(processed_folder, S_IRWXU);
closedir(dir);
while (1) {