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

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

bug#13125: Fix permissions bugs with setgid directories etc.


From: Paul Eggert
Subject: bug#13125: Fix permissions bugs with setgid directories etc.
Date: Sun, 09 Dec 2012 17:08:00 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/09/2012 09:03 AM, Eli Zaretskii wrote:

> Did you find _any_ of them that even reference this attribute?

Yes, just one: backup-buffer.  It's fixed in the proposed patch,
in the first hunk of the lisp/files.el patch.

> Given the "wide" use, it is hard to reason what should be the value of
> this attribute after these changes are installed.  You set them to
> zero, which is neither nil nor t; thus, code that was testing for
> either of these two values explicitly will now fail, while code that
> was testing for non-nil will succeed where perhaps it shouldn't have.

The only example I found, in backup-buffer, was testing for non-nil.
Zero counts as non-nil, so if backup-buffer were not changed, it'd be
treating the value as t.  This would be safe, as it's the nil case
that is dangerous.  (With the further change below, this paragraph is
moot.)

> I would suggest to leave the value at one of these
> two, whichever is more frequent in real life.

If we were to leave the value as one of these two, we should leave it
as t, the safer value.  Here's a further patch to do that, and I'll
attach the updated combined patch (integrating all the further patches
suggested so far), relative to trunk bzr 111167.

=== modified file 'doc/lispintro/ChangeLog'
--- doc/lispintro/ChangeLog     2012-12-09 02:30:06 +0000
+++ doc/lispintro/ChangeLog     2012-12-10 00:56:35 +0000
@@ -1,9 +1,9 @@
-2012-12-09  Paul Eggert  <eggert@cs.ucla.edu>
+2012-12-10  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix permissions bugs with setgid directories etc. (Bug#13125)
        * emacs-lisp-intro.texi (Files List):
-       directory-files-and-attributes now outputs 0 instead of t for
-       attribute that's now a placeholder.
+       directory-files-and-attributes now outputs t for attribute that's
+       now a placeholder.
 
 2012-12-06  Paul Eggert  <eggert@cs.ucla.edu>
 

=== modified file 'doc/lispintro/emacs-lisp-intro.texi'
--- doc/lispintro/emacs-lisp-intro.texi 2012-12-09 00:50:02 +0000
+++ doc/lispintro/emacs-lisp-intro.texi 2012-12-10 00:56:35 +0000
@@ -15687,7 +15687,7 @@
 "-rw-r--r--"
 @end group
 @group
-0
+t
 2971624
 773)
 @end group

=== modified file 'doc/lispref/files.texi'
--- doc/lispref/files.texi      2012-12-09 00:50:02 +0000
+++ doc/lispref/files.texi      2012-12-10 00:56:35 +0000
@@ -1281,7 +1281,7 @@
           (20000 23 0 0)
           (20614 64555 902289 872000)
           122295 "-rw-rw-rw-"
-          0  (5888 2 . 43978)
+          t (5888 2 . 43978)
           (15479 . 46724))
 @end group
 @end example
@@ -1320,7 +1320,7 @@
 @item "-rw-rw-rw-"
 has a mode of read and write access for the owner, group, and world.
 
-@item 0
+@item t
 is merely a placeholder; it carries no information.
 
 @item (5888 2 . 43978)

=== modified file 'src/dired.c'
--- src/dired.c 2012-12-09 00:50:02 +0000
+++ src/dired.c 2012-12-10 00:56:35 +0000
@@ -955,7 +955,7 @@
 
   filemodestring (&s, modes);
   values[8] = make_string (modes, 10);
-  values[9] = make_number (0);
+  values[9] = Qt;
   values[10] = INTEGER_TO_CONS (s.st_ino);
   values[11] = INTEGER_TO_CONS (s.st_dev);
 

Attachment: setgiddir.txt
Description: Text document


reply via email to

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