From 35053c1d4803738bb6f3c40c8418748e29358bfa Mon Sep 17 00:00:00 2001 From: Markus Wichmann Date: Sun, 20 Oct 2013 10:50:58 +0200 Subject: [PATCH] Make chmod honor S_ISVTX. --- chmod.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chmod.c b/chmod.c index 6d0f8a7..1f81977 100644 --- a/chmod.c +++ b/chmod.c @@ -95,6 +95,7 @@ parsemode(const char *str) if(*end == '\0') { if(octal & 04000) mode |= S_ISUID; if(octal & 02000) mode |= S_ISGID; + if(octal & 01000) mode |= S_ISVTX; if(octal & 00400) mode |= S_IRUSR; if(octal & 00200) mode |= S_IWUSR; if(octal & 00100) mode |= S_IXUSR; @@ -140,7 +141,10 @@ parsemode(const char *str) case 's': mode |= S_ISUID|S_ISGID; break; - /* error */ + case 't': + mode |= S_ISVTX; + break; + /* error */ default: eprintf("%s: invalid mode\n", str); }