From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Future of `[set-]file-extended-attributes'? Date: Sat, 28 Dec 2013 12:27:51 +0800 Message-ID: <87fvpdbnw8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388204889 27049 80.91.229.3 (28 Dec 2013 04:28:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Dec 2013 04:28:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 28 05:28:16 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VwlVX-0001QX-5V for ged-emacs-devel@m.gmane.org; Sat, 28 Dec 2013 05:28:15 +0100 Original-Received: from localhost ([::1]:51145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwlVW-0004oc-KF for ged-emacs-devel@m.gmane.org; Fri, 27 Dec 2013 23:28:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwlVM-0004oU-7I for emacs-devel@gnu.org; Fri, 27 Dec 2013 23:28:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VwlVD-0001cC-QE for emacs-devel@gnu.org; Fri, 27 Dec 2013 23:28:04 -0500 Original-Received: from mail-pb0-x231.google.com ([2607:f8b0:400e:c01::231]:38452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwlVD-0001by-Hm for emacs-devel@gnu.org; Fri, 27 Dec 2013 23:27:55 -0500 Original-Received: by mail-pb0-f49.google.com with SMTP id jt11so9691348pbb.8 for ; Fri, 27 Dec 2013 20:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=kQF2fnAyohIapH/LVIi4BacgNs8FgQ8je5wTtul6Pfk=; b=nYUeKz2hzB9ikcOQLLuBEkfPetsvMaezO0wn6zx622Jb9IFi0FvczHujAHP0KpafVE K7FFeT45TXSmDbs2fkHjxN5v6NRBzt6eVvBbiYru7cAqGzymeTQoLM3TgmWRJKMpLbk0 hmRLDL/WBfBcLwfuuzRy9kac0/n0zKzkV/yYCZcUxOcF3WAnxuLh9uM1UYtBxBFeLjot HGf6Dp9Wu08+925QA5CMCgJHzYaqkmGDVcpZUNjc77u/FVnhZ0puLWJFyVXLzhYJTyBe Tr0anqJhUdVk6YVg4r7NuopalRy2ZVw/1By5M6Ay/akJWJKRPcJSg3HZ/g/AZj2IbgtJ gMSA== X-Received: by 10.68.138.226 with SMTP id qt2mr54475391pbb.65.1388204874116; Fri, 27 Dec 2013 20:27:54 -0800 (PST) Original-Received: from tsparkle (cm233.delta179.maxonline.com.sg. [59.189.179.233]) by mx.google.com with ESMTPSA id by1sm65733034pbd.25.2013.12.27.20.27.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Dec 2013 20:27:52 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166938 Archived-At: I wonder how future-proof the `file-extended-attributes' and `set-file-extended-attributes' functions, new to Emacs 24.4, are. The names of these functions imply that they provide an Emacs Lisp interface for retrieving and setting extended attributes. Actually, they are currently just wrappers for the special cases of ACLs and SELinux contexts, which have special OS interfaces. In the future, we may want to provide an Emacs Lisp interface to handle arbitrary attributes. Currently, `set-file-extended-attributes' has the form: (set-file-extended-attributes FILENAME ATTRIBUTES) ATTRIBUTES is expected to be an alist like ((acl . ACL) (selinux-context . SEL-CONTEXT)) where ACL and SEL-CONTEXT seem to have some non-trivial structure not corresponding directly to the actual extended attributes to be set. That's because they are set via the special interfaces for ACLs (acl_set_file) and SELinux contexts (context_*_set), not the general interface for setting extended file attributes (setxattr). Is there a plan for extending `set-file-extended-attributes' to set an extended attribute, with a particular namespace, name, and value? I guess we could each element in ATTRIBUTES could be one of (SYMBOL . SPECIALLY-FORMATTED-ATTRIBUTES) (NAME-STRING VALUE [FLAGS]) where the first form is what we currently have and the second form would be for setting general attributes. Thoughts? I also wonder if it might not be cleaner to have a singular `set-file-extended-attribute' function instead.