mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00: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
1 changed files with 6 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue