mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 23:42:53 +03:00
ls: Show S in long mode if SUID/SGID bit is set for non-executable files
This commit is contained in:
parent
ad89aea1fe
commit
0266a32580
Notes:
sideshowbarker
2024-07-17 02:42:21 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/0266a32580 Pull-request: https://github.com/SerenityOS/serenity/pull/22868
@ -365,10 +365,14 @@ static bool print_filesystem_object(ByteString const& path, ByteString const& na
|
||||
printf("%c%c%c%c%c%c%c%c",
|
||||
st.st_mode & S_IRUSR ? 'r' : '-',
|
||||
st.st_mode & S_IWUSR ? 'w' : '-',
|
||||
st.st_mode & S_ISUID ? 's' : (st.st_mode & S_IXUSR ? 'x' : '-'),
|
||||
st.st_mode & S_ISUID
|
||||
? (st.st_mode & S_IXUSR ? 's' : 'S')
|
||||
: (st.st_mode & S_IXUSR ? 'x' : '-'),
|
||||
st.st_mode & S_IRGRP ? 'r' : '-',
|
||||
st.st_mode & S_IWGRP ? 'w' : '-',
|
||||
st.st_mode & S_ISGID ? 's' : (st.st_mode & S_IXGRP ? 'x' : '-'),
|
||||
st.st_mode & S_ISGID
|
||||
? (st.st_mode & S_IXGRP ? 's' : 'S')
|
||||
: (st.st_mode & S_IXGRP ? 'x' : '-'),
|
||||
st.st_mode & S_IROTH ? 'r' : '-',
|
||||
st.st_mode & S_IWOTH ? 'w' : '-');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user