/* insure our directories exist */
dir = opendir(core_folder);
if (!dir) {
- if (!mkdir(core_folder, S_IRWXU | S_IRWXG | S_IRWXO)
- && errno != EEXIST) {
- return 1;
- }
+ 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;
closedir(dir);
dir = opendir(processed_folder);
if (!dir) {
- if (!mkdir(processed_folder, S_IRWXU)
- && errno != EEXIST) {
- return 1;
- }
+ mkdir(processed_folder, S_IRWXU);
+ chmod(processed_folder, S_IRWXU);
dir = opendir(processed_folder);
if (!dir)
return 1;