GNU bug report logs - #8186
dired-font-lock-keywords should warn about SUID files too!

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Sun, 6 Mar 2011 09:29:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8186 in the body.
You can then email your comments to 8186 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Sun, 06 Mar 2011 09:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni <at> jidanni.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 06 Mar 2011 09:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: bug-gnu-emacs <at> gnu.org
Subject: dired-font-lock-keywords should warn about SUID files too!
Date: Sun, 06 Mar 2011 13:12:34 +0800
dired-font-lock-keywords is nice, but it totally forgot about the more
dangerous SUID and SGID 4xxx and 2xxx mode files! E.g.,
  -rwsr-xr-x  1 root root     33 Mar  6 12:59 somefile




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Sun, 06 Mar 2011 18:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <jidanni <at> jidanni.org>, <8186 <at> debbugs.gnu.org>
Subject: RE: bug#8186: dired-font-lock-keywords should warn about SUID files
	too!
Date: Sun, 6 Mar 2011 10:15:46 -0800
> dired-font-lock-keywords is nice, but it totally forgot about the more
> dangerous SUID and SGID 4xxx and 2xxx mode files! E.g.,
>   -rwsr-xr-x  1 root root     33 Mar  6 12:59 somefile

FWIW -

Dired fontification of permissions came from my suggestion many moon ago.
Acceptance was half-hearted and the feature was implemented only partially.

The different permissions have been highlighted individually in Dired+ for
decades, including the ones you mention.
http://www.emacswiki.org/emacs/download/dired%2b.el

So 1+ to your suggestion.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Sun, 06 Mar 2011 21:24:02 GMT) Full text and rfc822 format available.

Message #11 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: drew.adams <at> oracle.com
Cc: 8186 <at> debbugs.gnu.org
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
	too!
Date: Mon, 07 Mar 2011 05:23:12 +0800
Let's hope they adopt them into official emacs.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Sun, 06 Mar 2011 23:48:02 GMT) Full text and rfc822 format available.

Message #14 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <jidanni <at> jidanni.org>
Cc: 8186 <at> debbugs.gnu.org
Subject: RE: bug#8186: dired-font-lock-keywords should warn about SUID files
	too!
Date: Sun, 6 Mar 2011 13:45:12 -0800
> Let's hope they adopt them into official emacs.

Unlikely.  I've offered Dired+ more than once over the years.
Very few of the features have been added or imitated.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Mon, 14 Oct 2019 01:33:01 GMT) Full text and rfc822 format available.

Message #17 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: jidanni <at> jidanni.org
Cc: 8186 <at> debbugs.gnu.org
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Mon, 14 Oct 2019 03:32:00 +0200
jidanni <at> jidanni.org writes:

> dired-font-lock-keywords is nice, but it totally forgot about the more
> dangerous SUID and SGID 4xxx and 2xxx mode files! E.g.,
>   -rwsr-xr-x  1 root root     33 Mar  6 12:59 somefile

I've now made Emacs 27 font-lock these permissions with the warning face.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Oct 2019 01:33:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 8186 <at> debbugs.gnu.org and jidanni <at> jidanni.org Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Oct 2019 01:33:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Sun, 27 Oct 2019 22:03:02 GMT) Full text and rfc822 format available.

Message #24 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 8186 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Sun, 27 Oct 2019 23:28:52 +0200
>> dired-font-lock-keywords is nice, but it totally forgot about the more
>> dangerous SUID and SGID 4xxx and 2xxx mode files! E.g.,
>>   -rwsr-xr-x  1 root root     33 Mar  6 12:59 somefile
>
> I've now made Emacs 27 font-lock these permissions with the warning face.

I checked the directory /run and there is:

  drwxrwsr-x  3 postgres postgres   120 postgresql

where 'w' in group is rightfully highlighted with the 'dired-perm-write' face,
but 's' in the same group is not highlighted with the 'dired-set-id' face.

Is this intentional?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Mon, 28 Oct 2019 11:19:01 GMT) Full text and rfc822 format available.

Message #27 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 8186 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Mon, 28 Oct 2019 12:18:13 +0100
Juri Linkov <juri <at> linkov.net> writes:

> I checked the directory /run and there is:
>
>   drwxrwsr-x  3 postgres postgres   120 postgresql
>
> where 'w' in group is rightfully highlighted with the 'dired-perm-write' face,
> but 's' in the same group is not highlighted with the 'dired-set-id' face.
>
> Is this intentional?

No...  Do we need to add combinatorial versions of all the regexps to
dired-font-lock-keywords or is there a better way?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Mon, 28 Oct 2019 14:24:02 GMT) Full text and rfc822 format available.

Message #30 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Juri Linkov <juri <at> linkov.net>
Cc: 8186 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: RE: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Mon, 28 Oct 2019 07:23:01 -0700 (PDT)
> > I checked the directory /run and there is:
> >   drwxrwsr-x  3 postgres postgres   120 postgresql
> > where 'w' in group is rightfully highlighted with the 'dired-perm-write' face,
> > but 's' in the same group is not highlighted with the 'dired-set-id' face.
> > Is this intentional?
> 
> No...  Do we need to add combinatorial versions of all the regexps to
> dired-font-lock-keywords or is there a better way?

FWIW -

If by that you mean highlight the different privileges
for each possible role (other, group, user), then
`dired+.el' has done that since sometime in the 90s.
(I suggested it for Emacs back then.)

Not a big deal:

(list (concat dired-re-maybe-mark dired-re-inode-size
              "[-dl]........\\([lsStT]\\)")  ; o misc
      '(1 diredp-other-priv))
(list (concat dired-re-maybe-mark dired-re-inode-size
              "[-dl].....\\([lsStT]\\)...")  ; g misc
      '(1 diredp-other-priv))
(list (concat dired-re-maybe-mark dired-re-inode-size
              "[-dl]..\\([lsStT]\\)...")     ; u misc
      '(1 diredp-other-priv))
(list (concat dired-re-maybe-mark dired-re-inode-size
              "\\([bcsmpS]\\)")              ; (rare)
      '(1 diredp-rare-priv keep))

https://www.emacswiki.org/emacs/download/dired%2b.el




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Wed, 30 Oct 2019 12:33:01 GMT) Full text and rfc822 format available.

Message #33 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 8186 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Wed, 30 Oct 2019 13:31:54 +0100
Juri Linkov <juri <at> linkov.net> writes:

> I checked the directory /run and there is:
>
>   drwxrwsr-x  3 postgres postgres   120 postgresql
>
> where 'w' in group is rightfully highlighted with the 'dired-perm-write' face,
> but 's' in the same group is not highlighted with the 'dired-set-id' face.
>
> Is this intentional?

In my test cases, the setguid bit was shown like this:

  -rwxrwSrw-  1 larsi larsi    0 Oct 30 13:25 foo-test

But apparently on other systems it's a lower case S?

I've now adjusted the regexp to accept both.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Wed, 30 Oct 2019 13:07:01 GMT) Full text and rfc822 format available.

Message #36 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 8186 <at> debbugs.gnu.org, jidanni <at> jidanni.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Wed, 30 Oct 2019 14:06:24 +0100
On Okt 30 2019, Lars Ingebrigtsen wrote:

> But apparently on other systems it's a lower case S?

If you have a lower case s then it covers the x.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Wed, 30 Oct 2019 13:10:02 GMT) Full text and rfc822 format available.

Message #39 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Peder O. Klingenberg" <peder <at> klingenberg.no>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Wed, 30 Oct 2019 14:09:07 +0100
On Wed, 2019-10-30 13:31:54 +0100, Lars Ingebrigtsen wrote:

> In my test cases, the setguid bit was shown like this:
>
>   -rwxrwSrw-  1 larsi larsi    0 Oct 30 13:25 foo-test
>
> But apparently on other systems it's a lower case S?

The upper case S means that the x bit is not set.  Try chmod g+x
foo-test and see the upper case S change to a lower case.


...Peder...
-- 
I wish a new life awaited _me_ in some off-world colony.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8186; Package emacs. (Wed, 30 Oct 2019 13:17:02 GMT) Full text and rfc822 format available.

Message #42 received at 8186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Schwab <schwab <at> suse.de>
Cc: 8186 <at> debbugs.gnu.org, jidanni <at> jidanni.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#8186: dired-font-lock-keywords should warn about SUID files
 too!
Date: Wed, 30 Oct 2019 14:16:05 +0100
Andreas Schwab <schwab <at> suse.de> writes:

>> But apparently on other systems it's a lower case S?
>
> If you have a lower case s then it covers the x.

Ah, thanks.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 28 Nov 2019 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.