GNU bug report logs - #9817
24.0.90; tar-mode: wrong display of suid and sgid bits

Previous Next

Package: emacs;

Reported by: Ulrich Mueller <ulm <at> gentoo.org>

Date: Thu, 20 Oct 2011 22:39:01 UTC

Severity: normal

Found in version 24.0.90

Fixed in version 24.0.91

Done: Glenn Morris <rgm <at> gnu.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 9817 in the body.
You can then email your comments to 9817 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 bug-gnu-emacs <at> gnu.org:
bug#9817; Package emacs. (Thu, 20 Oct 2011 22:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Mueller <ulm <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 Oct 2011 22:39:02 GMT) Full text and rfc822 format available.

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

From: Ulrich Mueller <ulm <at> gentoo.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.90; tar-mode: wrong display of suid and sgid bits
Date: Fri, 21 Oct 2011 00:37:18 +0200
In the display of file modes in tar-mode's listing, the suid and sgid
bits are interchanged.

The following session illustrates the problem:

$ touch foo bar
$ chmod u+s foo
$ chmod g+s bar
$ ls -fl foo bar
-rwSr--r-- 1 ulm users 0 Oct 20 23:22 foo
-rw-r-Sr-- 1 ulm users 0 Oct 20 23:22 bar
$ tar cf foo.tar foo bar
$ tar tvf foo.tar
-rwSr--r-- ulm/users         0 2011-10-20 23:22 foo
-rw-r-Sr-- ulm/users         0 2011-10-20 23:22 bar
$ emacs -Q foo.tar

Now, in tar-mode's listing the two flags are interchanged:

 -rw-r-sr--     ulm/users         0 foo
 -rwsr--r--     ulm/users         0 bar

Also, they should be displayed with a capital letter S if the
corresponding executable bit is not set, and the sticky bit should
be shown, too. The patch included below fixes the problem for me.


2011-10-20  Ulrich Mueller  <ulm <at> gentoo.org>

	* tar-mode.el (tar-grind-file-mode): Display suid and sgid flags
	correctly.

@@ -404,13 +404,19 @@
   (string
    (if (zerop (logand 256 mode)) ?- ?r)
    (if (zerop (logand 128 mode)) ?- ?w)
-   (if (zerop (logand 1024 mode)) (if (zerop (logand  64 mode)) ?- ?x) ?s)
+   (if (zerop (logand 2048 mode))
+       (if (zerop (logand  64 mode)) ?- ?x)
+     (if (zerop (logand  64 mode)) ?S ?s))
    (if (zerop (logand  32 mode)) ?- ?r)
    (if (zerop (logand  16 mode)) ?- ?w)
-   (if (zerop (logand 2048 mode)) (if (zerop (logand   8 mode)) ?- ?x) ?s)
+   (if (zerop (logand 1024 mode))
+       (if (zerop (logand   8 mode)) ?- ?x)
+     (if (zerop (logand   8 mode)) ?S ?s))
    (if (zerop (logand   4 mode)) ?- ?r)
    (if (zerop (logand   2 mode)) ?- ?w)
-   (if (zerop (logand   1 mode)) ?- ?x)))
+   (if (zerop (logand 512 mode))
+       (if (zerop (logand   1 mode)) ?- ?x)
+     (if (zerop (logand   1 mode)) ?T ?t))))
 
 (defun tar-header-block-summarize (tar-hblock &optional mod-p)
   "Return a line similar to the output of `tar -vtf'."




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Fri, 21 Oct 2011 06:46:02 GMT) Full text and rfc822 format available.

Notification sent to Ulrich Mueller <ulm <at> gentoo.org>:
bug acknowledged by developer. (Fri, 21 Oct 2011 06:46:03 GMT) Full text and rfc822 format available.

Message #10 received at 9817-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9817-done <at> debbugs.gnu.org
Subject: Re: bug#9817: 24.0.90; tar-mode: wrong display of suid and sgid bits
Date: Fri, 21 Oct 2011 02:44:36 -0400
Version: 24.0.91

Thanks; applied.




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

This bug report was last modified 13 years and 303 days ago.

Previous Next


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