From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Matarazzo Newsgroups: gmane.emacs.devel Subject: Make local file variable c-file-offsets "safe" Date: Fri, 20 Jun 2014 17:39:12 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01538d50c08ebd04fc4dd6ff X-Trace: ger.gmane.org 1403333411 19848 80.91.229.3 (21 Jun 2014 06:50:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Jun 2014 06:50:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 21 08:50:02 2014 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 1WyF7h-00016U-TB for ged-emacs-devel@m.gmane.org; Sat, 21 Jun 2014 08:50:02 +0200 Original-Received: from localhost ([::1]:43948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyF7h-00051i-JH for ged-emacs-devel@m.gmane.org; Sat, 21 Jun 2014 02:50:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy9Ks-0003Vi-9l for emacs-devel@gnu.org; Fri, 20 Jun 2014 20:39:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy9Kr-0004Yi-GL for emacs-devel@gnu.org; Fri, 20 Jun 2014 20:39:14 -0400 Original-Received: from mail-qc0-x22a.google.com ([2607:f8b0:400d:c01::22a]:37589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy9Kr-0004Yd-Ce for emacs-devel@gnu.org; Fri, 20 Jun 2014 20:39:13 -0400 Original-Received: by mail-qc0-f170.google.com with SMTP id l6so4304679qcy.1 for ; Fri, 20 Jun 2014 17:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Y/XpMMqqIbhY1C6StZsplqNNt4Xg1GtrhBnLct0B1Iw=; b=HWy3iOYQ6rXfQKDMujc4EJpC4gIrVTLrxiF5OGU46IS3KLOVzPxlLRtoGDa4z0dNGd 2pMnsR6zs0lGy/SzyEvQQT325c7K+yE0stl9zE1rExU0KDhO/DT8ogx6PQlMt/QA0CiF /UqsnVLIGAHzqCBT/GQ4GjlH+qoyhLLjUR7XZSR9PU+tUXRE6xkOllL3tKhvoUgdNvfr 19d4laODZVuqjf9slnuBVH7SZUqs9uwrb3NapHMfcnDpDD9jYv5U46/r26ltTJjB/UTk 9AUttkxR4QfX26+BanTO33AKEGdIiF2Q9n3hQ7KdownZXPIawReBhNi8gGhoMsfQTUEU 3r+g== X-Received: by 10.224.163.11 with SMTP id y11mr10378771qax.43.1403311152465; Fri, 20 Jun 2014 17:39:12 -0700 (PDT) Original-Received: by 10.140.21.230 with HTTP; Fri, 20 Jun 2014 17:39:12 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::22a X-Mailman-Approved-At: Sat, 21 Jun 2014 02:49:58 -0400 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:172599 Archived-At: --089e01538d50c08ebd04fc4dd6ff Content-Type: text/plain; charset=UTF-8 I ran into a project using .dir-locals.el with a (c-file-offsets [alist]) construct. Every file I visited flagged this variable as an unsafe local file variable. cc-vars.el provides a safe-local-variable property to sanitize the other local file variable it has, c-file-style, so why not c-file-offsets? It could be as simple as making the predicate 'listp, or if desired, do something fancier and check that each car of the list is key in the c-offsets-alist. Thoughts? Thanks, Joe --089e01538d50c08ebd04fc4dd6ff Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I ran into a project using .dir-locals.el with a (c-file-o= ffsets [alist]) construct. Every file I visited flagged this variable as an= unsafe local file variable.

cc-vars.el provides a safe-= local-variable property to sanitize the other local file variable it has, c= -file-style, so why not c-file-offsets?

It could be as simple as making the predicate 'list= p, or if desired, do something fancier and check that each car of the list = is key in the c-offsets-alist.

Thoughts?

Thanks,
Joe


=C2=A0
--089e01538d50c08ebd04fc4dd6ff--