diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2012-12-29 16:32:36 +0200 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2012-12-29 16:32:36 +0200 |
| commit | ccad023bc3c70fc8368c00f7ed2f5ec947a4260d (patch) | |
| tree | c6471cecd468c61a1a81860215f731e265721a88 /src | |
| parent | ccb1c17e8bf1aa0d21bddd9fa37154a120657f52 (diff) | |
| download | emacs-ccad023bc3c70fc8368c00f7ed2f5ec947a4260d.tar.gz | |
Fix bug #13298 with failed backups by falling back on set-file-modes.
src/fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
file's SELinux context or ACLs successfully set, nil otherwise.
lisp/files.el (backup-buffer-copy, basic-save-buffer-2): If
set-file-extended-attributes fails, fall back on set-file-modes
instead of signaling an error.
doc/lispref/files.texi (Changing Files): Document the return values of
set-file-selinux-context and set-file-acl.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fileio.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 76f6865972c..f40f936d13a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-12-29 Eli Zaretskii <eliz@gnu.org> + * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if + file's SELinux context or ACLs successfully set, nil otherwise. + (Bug#13298) + * w32proc.c (reader_thread): Avoid passing NULL handles to SetEvent and WaitForSingleObject. diff --git a/src/fileio.c b/src/fileio.c index 9f70c790592..e824a7abcc5 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2996,8 +2996,10 @@ DEFUN ("set-file-selinux-context", Fset_file_selinux_context, CONTEXT should be a list (USER ROLE TYPE RANGE), where the list elements are strings naming the components of a SELinux context. -This function does nothing if SELinux is disabled, or if Emacs was not -compiled with SELinux support. */) +Value is t if setting of SELinux context was successful, nil otherwise. + +This function does nothing and returns nil if SELinux is disabled, +or if Emacs was not compiled with SELinux support. */) (Lisp_Object filename, Lisp_Object context) { Lisp_Object absname; @@ -3063,6 +3065,7 @@ compiled with SELinux support. */) context_free (parsed_con); freecon (con); + return Qt; } else report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); @@ -3127,6 +3130,8 @@ DEFUN ("set-file-acl", Fset_file_acl, Sset_file_acl, ACL-STRING should contain the textual representation of the ACL entries in a format suitable for the platform. +Value is t if setting of ACL was successful, nil otherwise. + Setting ACL for local files requires Emacs to be built with ACL support. */) (Lisp_Object filename, Lisp_Object acl_string) @@ -3166,6 +3171,7 @@ support. */) report_file_error ("Setting ACL", Fcons (absname, Qnil)); acl_free (acl); + return Qt; } #endif |
