Make chmod and ls recognize sticky bit (S_ISVTX).
This commit is contained in:
parent
35053c1d48
commit
a55cc8c95e
4
chmod.c
4
chmod.c
|
@ -31,9 +31,9 @@ main(int argc, char *argv[])
|
||||||
case 'R':
|
case 'R':
|
||||||
rflag = true;
|
rflag = true;
|
||||||
break;
|
break;
|
||||||
case 'r': case 'w': case 'x': case 's':
|
case 'r': case 'w': case 'x': case 's': case 't':
|
||||||
/*
|
/*
|
||||||
* -[rwxs] are valid modes so do not interpret
|
* -[rwxst] are valid modes so do not interpret
|
||||||
* them as options - in any case we are done if
|
* them as options - in any case we are done if
|
||||||
* we hit this case
|
* we hit this case
|
||||||
*/
|
*/
|
||||||
|
|
1
ls.c
1
ls.c
|
@ -228,6 +228,7 @@ output(Entry *ent)
|
||||||
|
|
||||||
if(ent->mode & S_ISUID) mode[3] = (mode[3] == 'x') ? 's' : 'S';
|
if(ent->mode & S_ISUID) mode[3] = (mode[3] == 'x') ? 's' : 'S';
|
||||||
if(ent->mode & S_ISGID) mode[6] = (mode[6] == 'x') ? 's' : 'S';
|
if(ent->mode & S_ISGID) mode[6] = (mode[6] == 'x') ? 's' : 'S';
|
||||||
|
if(ent->mode & S_ISVTX) mode[9] = (mode[9] == 'x') ? 't' : 'T';
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
pw = getpwuid(ent->uid);
|
pw = getpwuid(ent->uid);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user