Make chmod honor S_ISVTX.

This commit is contained in:
Markus Wichmann 2013-10-20 10:50:58 +02:00 committed by sin
parent a4eb639ba7
commit 35053c1d48

View File

@ -95,6 +95,7 @@ parsemode(const char *str)
if(*end == '\0') { if(*end == '\0') {
if(octal & 04000) mode |= S_ISUID; if(octal & 04000) mode |= S_ISUID;
if(octal & 02000) mode |= S_ISGID; if(octal & 02000) mode |= S_ISGID;
if(octal & 01000) mode |= S_ISVTX;
if(octal & 00400) mode |= S_IRUSR; if(octal & 00400) mode |= S_IRUSR;
if(octal & 00200) mode |= S_IWUSR; if(octal & 00200) mode |= S_IWUSR;
if(octal & 00100) mode |= S_IXUSR; if(octal & 00100) mode |= S_IXUSR;
@ -140,6 +141,9 @@ parsemode(const char *str)
case 's': case 's':
mode |= S_ISUID|S_ISGID; mode |= S_ISUID|S_ISGID;
break; break;
case 't':
mode |= S_ISVTX;
break;
/* error */ /* error */
default: default:
eprintf("%s: invalid mode\n", str); eprintf("%s: invalid mode\n", str);