Re: [dev] [sup] [PATCH] make sup usable in most distros.

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Sun, 16 Mar 2014 03:09:27 +0100

Most distros install binaries with write permissions for the owner (root). We
don't need to check them, since the owner can always also change the permission.

Also many packaging systems use symlinks to organize different versions or
alternatives of programms. Also busybox style toolkits use symlinks, so we
should follow them.
---
Heyho,
Thanks, fixed.
Is there an active maintainer for sup?
Regards,
Markus
 sup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sup.c b/sup.c
index b88d949..0b99834 100644
--- a/sup.c
+++ b/sup.c
_AT_@ -72,9 +72,9 @@ int main(int argc, char **argv) {
 				else if (!(cmd = getpath (argv[1])))
 					return die (1, "execv", "cannot find program");
 			} else cmd = rules[i].path;
-			if (lstat (cmd, &st) == -1)
-				return die (1, "lstat", "cannot stat program");
-			if (st.st_mode & 0222)
+			if (stat (cmd, &st) == -1)
+				return die (1, "stat", "cannot stat program");
+			if (st.st_mode & 0022)
 				return die (1, "stat", "cannot run writable binaries.");
 #endif
 			if (uid != SETUID && rules[i].uid != -1 && rules[i].uid != uid)
-- 
1.8.2
Received on Sun Mar 16 2014 - 03:09:27 CET

This archive was generated by hypermail 2.3.0 : Sun Mar 16 2014 - 03:12:06 CET