summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>1998-09-10 18:10:59 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>1998-09-10 18:10:59 (GMT)
commit1deebabc77ac4cb5a002d92c5d5ede764cf289ed (patch)
treee6b622ad43fdaf8e61cd80931a1380aab358bca2 /Misc
parent3494e4a31f262523e84bf7f1eb243ad2cd0786e2 (diff)
downloadcpython-1deebabc77ac4cb5a002d92c5d5ede764cf289ed.zip
cpython-1deebabc77ac4cb5a002d92c5d5ede764cf289ed.tar.gz
cpython-1deebabc77ac4cb5a002d92c5d5ede764cf289ed.tar.bz2
include <string.h> to get prototype for strcmp
change error messages to be a little more straightforward change definition of FULL_PATH so that an error is raised if the setuid wrapper is used un-edited
Diffstat (limited to 'Misc')
-rw-r--r--Misc/setuid-prog.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Misc/setuid-prog.c b/Misc/setuid-prog.c
index b49438a..ddc2f64 100644
--- a/Misc/setuid-prog.c
+++ b/Misc/setuid-prog.c
@@ -50,11 +50,15 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <string.h>
/* CONFIGURATION SECTION */
#ifndef FULL_PATH /* so that this can be specified from the Makefile */
-#define FULL_PATH "/full/path/of/script"
+/* Uncomment out the following line:
+#define FULL_PATH "/full/path/of/script"
+* Then comment out the #error line. */
+#error "Must define SCRIPTPATH in the Makefile"
#endif
#ifndef UMASK
#define UMASK 077
@@ -133,9 +137,8 @@ main(int argc, char **argv)
if (FULL_PATH[0] != '/') {
fprintf(stderr, "%s: %s is not a full path name\n", argv[0],
FULL_PATH);
- fprintf(stderr, "Tell this program's maintainer that s\\he ");
- fprintf(stderr, "fouled up some simple rules\n");
- fprintf(stderr, "pretty badly.\n");
+ fprintf(stderr, "You can only use this wrapper if you\n");
+ fprintf(stderr, "compile it with an absolute path.\n");
exit(1);
}
@@ -151,9 +154,8 @@ main(int argc, char **argv)
if (statb.st_uid != 0 && statb.st_uid != euid) {
fprintf(stderr, "%s: %s has the wrong owner\n", argv[0],
FULL_PATH);
- fprintf(stderr, "Tell this program's maintainer that the ");
- fprintf(stderr, "script should be owned by him/herself or the\n");
- fprintf(stderr, "superuser.\n");
+ fprintf(stderr, "The script should be owned by root,\n");
+ fprintf(stderr, "and shouldn't be writeable by anyone.\n");
exit(1);
}