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

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

bug#12632: file permissions checking mishandled when setuid


From: Paul Eggert
Subject: bug#12632: file permissions checking mishandled when setuid
Date: Mon, 22 Oct 2012 18:46:56 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

On 10/22/2012 05:40 PM, Stefan Monnier wrote:
>>> We use IS_DIRECTORY_SEP in other places, so why avoid it here?
>> > If it's not needed, it makes the code a bit harder to read.
> I don't see why.  The name says very clearly what it is intended to do.
> On the contrary, it seems more clear than comparing with '/' which only
> makes sense if you happen to know that / is the special char used as
> directory-separator.

Using IS_DIRECTORY_SEP indicates that it's necessary to
process a file name using a system-dependent interpretation
rather than the standard POSIX interpretation.  When
plain X=='/' would do, it can mislead the reader if the code
does IS_DIRECTORY_SEP (X), as the reader may naturally (and
mistakenly) infer that the code was written that way because
it must treat '\' specially on Windows.  It's primarily
this clarity, not the brevity, that I was referring to.






reply via email to

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