Fix return value of 'set-file-extended-attributes'
* lisp/files.el (set-file-extended-attributes): Return non-nil when setting either ACLs or SELinux context succeeds. Document the return value. (Bug#21699) * doc/lispref/files.texi (Changing Files): Document the return value of set-file-extended-attributes.
This commit is contained in:
parent
552482d41d
commit
f1575763c0
2 changed files with 15 additions and 8 deletions
|
@ -4055,14 +4055,19 @@ such as SELinux context, list of ACL entries, etc."
|
|||
"Set extended attributes of file FILENAME to ATTRIBUTES.
|
||||
|
||||
ATTRIBUTES must be an alist of file attributes as returned by
|
||||
`file-extended-attributes'."
|
||||
(dolist (elt attributes)
|
||||
(let ((attr (car elt))
|
||||
(val (cdr elt)))
|
||||
(cond ((eq attr 'acl)
|
||||
(set-file-acl filename val))
|
||||
((eq attr 'selinux-context)
|
||||
(set-file-selinux-context filename val))))))
|
||||
`file-extended-attributes'.
|
||||
Value is t if the function succeeds in setting the attributes."
|
||||
(let (result rv)
|
||||
(dolist (elt attributes)
|
||||
(let ((attr (car elt))
|
||||
(val (cdr elt)))
|
||||
(cond ((eq attr 'acl)
|
||||
(setq rv (set-file-acl filename val)))
|
||||
((eq attr 'selinux-context)
|
||||
(setq rv (set-file-selinux-context filename val))))
|
||||
(setq result (or result rv))))
|
||||
|
||||
result))
|
||||
|
||||
(defun backup-buffer ()
|
||||
"Make a backup of the disk file visited by the current buffer, if appropriate.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue