Bug 95477 - FcAtomicLock fails when SELinux denies link() syscall with EACCES
Summary: FcAtomicLock fails when SELinux denies link() syscall with EACCES
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.11
Hardware: All Linux (All)
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-18 20:55 UTC by Rodger Combs
Modified: 2016-05-19 02:12 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

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.