bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21699: 24.5; Bug in backup-buffer-copy and/or set-file-extended-attr


From: Eli Zaretskii
Subject: bug#21699: 24.5; Bug in backup-buffer-copy and/or set-file-extended-attributes etc [set-file-extended-attributes]
Date: Mon, 19 Oct 2015 10:09:36 +0300

> Date: Mon, 19 Oct 2015 09:50:06 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 21699@debbugs.gnu.org
> 
> > Date: Mon, 19 Oct 2015 09:38:08 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: 21699@debbugs.gnu.org
> > 
> > So after fixing set-file-extended-attributes as you suggest, does the
> > problem still happen for you?
> 
> Actually, your suggested variant also returns nil for me.  I need
> something like this instead:
> 
>   (defun set-file-extended-attributes (filename attributes)
>     "Set extended attributes of file FILENAME to ATTRIBUTES.
> 
>   ATTRIBUTES must be an alist of file attributes as returned by
>   `file-extended-attributes'."
>     (let (result)
>       (dolist (elt attributes)
>       (let ((attr (car elt))
>             (val (cdr elt)))
>         (cond ((eq attr 'acl)
>                (setq result (or result
>                                 (set-file-acl filename val))))
>               ((eq attr 'selinux-context)
>                (setq result (or result
>                                 (set-file-selinux-context filename val)))))))
>       result))

I installed a slightly different variant of this (which always invokes
the corresponding low-level primitive for each type of extended
attributes, instead of skipping all those after the first success), to
keep the original semantics.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]