Stop calling chmod() in cache update code.
These calls are useless to toxic and come in the way of adding pledge to applications (would require 'fattr' which is quite wide). Discussed with deraadt, millert and jcs. Submitted upstreams too.
This commit is contained in:
parent
1e2269ecbb
commit
96afcbe794
10
dist/fontconfig/src/fccache.c
vendored
10
dist/fontconfig/src/fccache.c
vendored
@ -1030,16 +1030,6 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Otherwise, try making it writable
|
||||
*/
|
||||
else if (chmod ((char *) d, 0755) == 0)
|
||||
{
|
||||
cache_dir = FcStrCopyFilename (d);
|
||||
/* Try to create CACHEDIR.TAG too */
|
||||
FcDirCacheCreateTagFile (d);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (d)
|
||||
|
4
dist/fontconfig/src/fccompat.c
vendored
4
dist/fontconfig/src/fccompat.c
vendored
@ -249,9 +249,9 @@ FcMakeDirectory (const FcChar8 *dir)
|
||||
if (!parent)
|
||||
return FcFalse;
|
||||
if (access ((char *) parent, F_OK) == 0)
|
||||
ret = mkdir ((char *) dir, 0755) == 0 && chmod ((char *) dir, 0755) == 0;
|
||||
ret = mkdir ((char *) dir, 0755) == 0;
|
||||
else if (access ((char *) parent, F_OK) == -1)
|
||||
ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0) && chmod ((char *) dir, 0755) == 0;
|
||||
ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0);
|
||||
else
|
||||
ret = FcFalse;
|
||||
FcStrFree (parent);
|
||||
|
Loading…
Reference in New Issue
Block a user