]> git.wh0rd.org - fontconfig.git/commitdiff
Don't use X_OK bit when checking for writable directories (bug 12438)
authorKeith Packard <keithp@koto.keithp.com>
Thu, 18 Oct 2007 12:04:39 +0000 (05:04 -0700)
committerKeith Packard <keithp@koto.keithp.com>
Thu, 18 Oct 2007 12:04:39 +0000 (05:04 -0700)
Some mingw versions have broken X_OK checking; instead of trying to work
around this in a system-depedent manner, simply don't bother checking for
X_OK along with W_OK as such cases are expected to be mistakes, and not
sensible access control.

fc-cache/fc-cache.c
src/fccache.c

index 531e8fb0bfbecb250010d9da7ff6c939ef03a451..dda40c19007e69ca7d37e2bebbb6c011e8c8ba18 100644 (file)
@@ -264,7 +264,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
        fprintf (stderr, "%s: out of memory\n", dir);
        return FcFalse;
     }
-    if (access ((char *) dir, W_OK|X_OK) != 0)
+    if (access ((char *) dir, W_OK) != 0)
     {
        if (verbose)
            printf ("%s: not cleaning %s cache directory\n", dir,
index a6b532fa118c148c7eb80b49bf362941e2f79da4..c43609ccdd735f734fb2341cfbca813a8549dbbe 100644 (file)
@@ -727,7 +727,7 @@ FcMakeDirectory (const FcChar8 *dir)
     parent = FcStrDirname (dir);
     if (!parent)
        return FcFalse;
-    if (access ((char *) parent, W_OK|X_OK) == 0)
+    if (access ((char *) parent, F_OK) == 0)
        ret = mkdir ((char *) dir, 0777) == 0;
     else if (access ((char *) parent, F_OK) == -1)
        ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0777) == 0);
@@ -760,7 +760,7 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
     if (!list)
        return FcFalse;
     while ((test_dir = FcStrListNext (list))) {
-       if (access ((char *) test_dir, W_OK|X_OK) == 0)
+       if (access ((char *) test_dir, W_OK) == 0)
        {
            cache_dir = test_dir;
            break;