Hi!
I noticed that executin stat -x on a setuid or setgid file don't display
the setuid/setgid mode in the numeric Mode: field:
$ /usr/bin/stat -x /usr/bin/passwd
File: "/usr/bin/passwd"
Size: 22484 FileType: Regular File
Mode: (0555/-r-sr-xr-x) [...]
^
This patch solves it by removing some format characters:
Index: stat.c
===================================================================
RCS file: /cvs/src/usr.bin/stat/stat.c,v
retrieving revision 1.16
diff -p -u -r1.16 stat.c
--- stat.c 1 Sep 2010 06:35:05 -0000 1.16
+++ stat.c 2 Oct 2010 17:35:17 -0000
@@ -60,7 +60,7 @@
#define LINUX_FORMAT \
" File: \"%N\"%n" \
" Size: %-11z FileType: %HT%n" \
- " Mode: (%04OLp/%.10Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%n" \
+ " Mode: (%p/%.10Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%n" \
"Device: %Hd,%Ld Inode: %i Links: %l%n" \
"Access: %Sa%n" \
"Modify: %Sm%n" \
After this:
$ /usr/bin/stat -x /usr/bin/passwd
File: "/usr/bin/passwd"
Size: 22484 FileType: Regular File
Mode: (104555/-r-sr-xr-x)
^^^
Daniel
--
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F