if (!parent)
return FcFalse;
if (access ((char *) parent, F_OK) == 0)
- ret = mkdir ((char *) dir, 0777) == 0;
+ ret = mkdir ((char *) dir, 0755) == 0 && chmod ((char *) dir, 0755) == 0;
else if (access ((char *) parent, F_OK) == -1)
- ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0777) == 0);
+ ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0) && chmod ((char *) dir, 0755) == 0;
else
ret = FcFalse;
FcStrFree (parent);
if (!list)
return FcFalse;
while ((test_dir = FcStrListNext (list))) {
- if (access ((char *) test_dir, W_OK) == 0)
+ if (access ((char *) test_dir, W_OK|X_OK) == 0)
{
cache_dir = test_dir;
break;
break;
}
}
+ /*
+ * Otherwise, try making it writable
+ */
+ else if (chmod ((char *) test_dir, 0755) == 0)
+ {
+ cache_dir = test_dir;
+ break;
+ }
}
}
FcStrListDone (list);