diff options
| author | Glenn Morris | 2012-04-20 13:34:51 -0400 |
|---|---|---|
| committer | Glenn Morris | 2012-04-20 13:34:51 -0400 |
| commit | 24c51a09d6150ca56383a091fc945210ff3fe673 (patch) | |
| tree | cc80832d3ff6f17c40574fbf09b6cff72496090b /src | |
| parent | 73055685ff9e9d3557ab378e276d42d82952ac7c (diff) | |
| download | emacs-24c51a09d6150ca56383a091fc945210ff3fe673.tar.gz emacs-24c51a09d6150ca56383a091fc945210ff3fe673.zip | |
fileio.c fix for bug#11245
* src/fileio.c (Fcopy_file, Fset_file_selinux_context):
Ignore ENOTSUP failures from setfilecon functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fileio.c | 12 |
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 @@ | |||
| 1 | 2012-04-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * fileio.c (Fcopy_file, Fset_file_selinux_context): | ||
| 4 | Ignore ENOTSUP failures from setfilecon functions. (Bug#11245) | ||
| 5 | |||
| 1 | 2012-04-20 Eli Zaretskii <eliz@gnu.org> | 6 | 2012-04-20 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't | 8 | * 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 @@ | |||
| 1 | /* File IO for GNU Emacs. | 1 | /* File IO for GNU Emacs. |
| 2 | 2 | ||
| 3 | Copyright (C) 1985-1988, 1993-2012 Free Software Foundation, Inc. | 3 | Copyright (C) 1985-1988, 1993-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -2044,9 +2044,10 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */) | |||
| 2044 | #if HAVE_LIBSELINUX | 2044 | #if HAVE_LIBSELINUX |
| 2045 | if (conlength > 0) | 2045 | if (conlength > 0) |
| 2046 | { | 2046 | { |
| 2047 | /* Set the modified context back to the file. */ | 2047 | /* Set the modified context back to the file. */ |
| 2048 | fail = fsetfilecon (ofd, con); | 2048 | fail = fsetfilecon (ofd, con); |
| 2049 | if (fail) | 2049 | /* See http://debbugs.gnu.org/11245 for ENOTSUP. */ |
| 2050 | if (fail && errno != ENOTSUP) | ||
| 2050 | report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil)); | 2051 | report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil)); |
| 2051 | 2052 | ||
| 2052 | freecon (con); | 2053 | freecon (con); |
| @@ -2917,10 +2918,11 @@ compiled with SELinux support. */) | |||
| 2917 | error ("Doing context_range_set"); | 2918 | error ("Doing context_range_set"); |
| 2918 | } | 2919 | } |
| 2919 | 2920 | ||
| 2920 | /* Set the modified context back to the file. */ | 2921 | /* Set the modified context back to the file. */ |
| 2921 | fail = lsetfilecon (SSDATA (encoded_absname), | 2922 | fail = lsetfilecon (SSDATA (encoded_absname), |
| 2922 | context_str (parsed_con)); | 2923 | context_str (parsed_con)); |
| 2923 | if (fail) | 2924 | /* See http://debbugs.gnu.org/11245 for ENOTSUP. */ |
| 2925 | if (fail && errno != ENOTSUP) | ||
| 2924 | report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); | 2926 | report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); |
| 2925 | 2927 | ||
| 2926 | context_free (parsed_con); | 2928 | context_free (parsed_con); |