Commit: 19e5302d9792cc057803889849f7155692f170f3
Parent: f991d0f168c741315a8c980cf289f0cda4a6ac48
Author: opask
Date: Fri, 7 Dec 2018 20:55:01 -0700
file.c: never set execute bit or sticky bit
Diffstat:
M | file.c | | | 26 | ++------------------------ |
1 file changed, 2 insertions(+), 24 deletions(-)
diff --git a/file.c b/file.c
@@ -5,33 +5,12 @@
#include "links.h"
+#include <sys/stat.h>
+
static void setrwx(unsigned m, unsigned char *p)
{
if (m & S_IRUSR) p[0] = 'r';
if (m & S_IWUSR) p[1] = 'w';
- if (m & S_IXUSR) p[2] = 'x';
-}
-
-static void setst(unsigned m, unsigned char *p)
-{
-#ifdef S_ISUID
- if (m & S_ISUID) {
- p[2] = 'S';
- if (m & S_IXUSR) p[2] = 's';
- }
-#endif
-#ifdef S_ISGID
- if (m & S_ISGID) {
- p[5] = 'S';
- if (m & S_IXGRP) p[5] = 's';
- }
-#endif
-#ifdef S_ISVTX
- if (m & S_ISVTX) {
- p[8] = 'T';
- if (m & S_IXOTH) p[8] = 't';
- }
-#endif
}
static void stat_mode(unsigned char **p, int *l, struct stat *stp)
@@ -68,7 +47,6 @@ static void stat_mode(unsigned char **p, int *l, struct stat *stp)
setrwx(mode << 0, &rwx[0]);
setrwx(mode << 3, &rwx[3]);
setrwx(mode << 6, &rwx[6]);
- setst(mode, rwx);
}
add_to_str(p, l, rwx);
}