summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-04-20 13:34:51 -0400
committerGlenn Morris <rgm@gnu.org>2012-04-20 13:34:51 -0400
commit24c51a09d6150ca56383a091fc945210ff3fe673 (patch)
treecc80832d3ff6f17c40574fbf09b6cff72496090b
parent73055685ff9e9d3557ab378e276d42d82952ac7c (diff)
downloademacs-24c51a09d6150ca56383a091fc945210ff3fe673.tar.gz
fileio.c fix for bug#11245
* src/fileio.c (Fcopy_file, Fset_file_selinux_context): Ignore ENOTSUP failures from setfilecon functions.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fileio.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c232420d0b1..2d5520c9dbb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-20 Glenn Morris <rgm@gnu.org>
+
+ * fileio.c (Fcopy_file, Fset_file_selinux_context):
+ Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
+
2012-04-20 Eli Zaretskii <eliz@gnu.org>
* dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't
diff --git a/src/fileio.c b/src/fileio.c
index 7efe919a9f0..0d1a87b65b7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,6 @@
/* File IO for GNU Emacs.
-Copyright (C) 1985-1988, 1993-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2044,9 +2044,10 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
#if HAVE_LIBSELINUX
if (conlength > 0)
{
- /* Set the modified context back to the file. */
+ /* Set the modified context back to the file. */
fail = fsetfilecon (ofd, con);
- if (fail)
+ /* See http://debbugs.gnu.org/11245 for ENOTSUP. */
+ if (fail && errno != ENOTSUP)
report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil));
freecon (con);
@@ -2917,10 +2918,11 @@ compiled with SELinux support. */)
error ("Doing context_range_set");
}
- /* Set the modified context back to the file. */
+ /* Set the modified context back to the file. */
fail = lsetfilecon (SSDATA (encoded_absname),
context_str (parsed_con));
- if (fail)
+ /* See http://debbugs.gnu.org/11245 for ENOTSUP. */
+ if (fail && errno != ENOTSUP)
report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
context_free (parsed_con);