Bug 95477

Summary: FcAtomicLock fails when SELinux denies link() syscall with EACCES
Product: fontconfig Reporter: Rodger Combs <rodger.combs>
Component: libraryAssignee: fontconfig-bugs
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira, rodger.combs
Version: 2.11   
Hardware: All   
OS: Linux (All)   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=82358
Whiteboard:
i915 platform: i915 features:

Description Rodger Combs 2016-05-18 20:55:41 UTC
See also: #82358
This is an issue on Android M, which denies non-root users access to link(). Patch:
diff --git a/src/fcatomic.c b/src/fcatomic.c
index 2ce419f..d12d324 100644
--- a/src/fcatomic.c
+++ b/src/fcatomic.c
@@ -131,7 +131,7 @@ FcAtomicLock (FcAtomic *atomic)
 	return FcFalse;
     }
     ret = link ((char *) atomic->tmp, (char *) atomic->lck);
-    if (ret < 0 && (errno == EPERM || errno == ENOTSUP))
+    if (ret < 0 && (errno == EPERM || errno == ENOTSUP || errno == EACCES))
     {
 	/* the filesystem where atomic->lck points to may not supports
 	 * the hard link. so better try to fallback
Comment 1 Akira TAGOH 2016-05-19 02:12:36 UTC
Thanks. applied.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.