summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/mtree/BSD.local.dist8
-rw-r--r--etc/mtree/BSD.usr.dist8
-rw-r--r--etc/mtree/BSD.x11-4.dist4
-rw-r--r--etc/mtree/BSD.x11.dist4
-rw-r--r--gnu/usr.bin/man/man/Makefile5
-rw-r--r--gnu/usr.bin/man/man/man.c64
6 files changed, 10 insertions, 83 deletions
diff --git a/etc/mtree/BSD.local.dist b/etc/mtree/BSD.local.dist
index 2b9f191..43b5ea2 100644
--- a/etc/mtree/BSD.local.dist
+++ b/etc/mtree/BSD.local.dist
@@ -40,7 +40,6 @@
libexec
..
man
-/set uname=man
cat1
..
cat2
@@ -63,7 +62,7 @@
..
catn
..
- de.ISO8859-1 uname=root
+ de.ISO8859-1
cat1
..
cat2
@@ -86,7 +85,6 @@
..
catn
..
-/set uname=root
man1
..
man2
@@ -111,7 +109,6 @@
..
..
en.ISO8859-1
-/set uname=man
cat1
..
cat1aout
@@ -145,7 +142,7 @@
catn
..
..
- ja uname=root
+ ja
cat1
..
cat2
@@ -168,7 +165,6 @@
..
catn
..
-/set uname=root
man1
..
man2
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index d65480e..14b5dee 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -645,7 +645,6 @@
..
..
man
-/set uname=man
cat1
..
cat1aout
@@ -678,7 +677,7 @@
..
catn
..
- en.ISO8859-1 uname=root
+ en.ISO8859-1
cat1
..
cat1aout
@@ -712,7 +711,7 @@
catn
..
..
- ja uname=root
+ ja
cat1
..
cat2
@@ -733,7 +732,6 @@
..
catn
..
-/set uname=root
man1
..
man2
@@ -970,7 +968,7 @@
..
perl
man
- cat3 uname=man
+ cat3
..
man3
..
diff --git a/etc/mtree/BSD.x11-4.dist b/etc/mtree/BSD.x11-4.dist
index dca7d08..b10b001 100644
--- a/etc/mtree/BSD.x11-4.dist
+++ b/etc/mtree/BSD.x11-4.dist
@@ -314,7 +314,6 @@
libexec
..
man
-/set uname=man
cat1
..
cat2
@@ -337,7 +336,7 @@
..
catn
..
- ja uname=root
+ ja
cat1
..
cat2
@@ -360,7 +359,6 @@
..
catn
..
-/set uname=root
man1
..
man2
diff --git a/etc/mtree/BSD.x11.dist b/etc/mtree/BSD.x11.dist
index ef33781..81ddaed 100644
--- a/etc/mtree/BSD.x11.dist
+++ b/etc/mtree/BSD.x11.dist
@@ -196,7 +196,6 @@
libexec
..
man
-/set uname=man
cat1
..
cat2
@@ -219,7 +218,7 @@
..
catn
..
- ja uname=root
+ ja
cat1
..
cat2
@@ -242,7 +241,6 @@
..
catn
..
-/set uname=root
man1
..
man2
diff --git a/gnu/usr.bin/man/man/Makefile b/gnu/usr.bin/man/man/Makefile
index 0998b96..905d4db 100644
--- a/gnu/usr.bin/man/man/Makefile
+++ b/gnu/usr.bin/man/man/Makefile
@@ -5,9 +5,6 @@ MAN_LIBZ=YES
PROG= man
SRCS= man.c manpath.c glob.c
-BINOWN= man
-BINMODE=4555
-INSTALLFLAGS= -fschg
CFLAGS+= -I${LIBDESTDIR}
DPADD= ${LIBMAN}
@@ -20,7 +17,7 @@ CFLAGS+=-DHAVE_LIBZ=1
.endif
CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF
-CFLAGS+= -DDO_COMPRESS -DSETUID -DCATMODE=0644
+CFLAGS+= -DDO_COMPRESS -DCATMODE=0644
CLEANFILES+= man.1
.PATH: ${.CURDIR}/../manpath
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c
index 2f8849b..921295a 100644
--- a/gnu/usr.bin/man/man/man.c
+++ b/gnu/usr.bin/man/man/man.c
@@ -121,11 +121,6 @@ static char args[] = "M:P:S:adfhkm:p:w?";
#endif
#endif
-#ifdef SETUID
-uid_t ruid;
-uid_t euid;
-#endif
-
int
main (argc, argv)
int argc;
@@ -163,12 +158,6 @@ main (argc, argv)
gripe_no_name (tmp);
}
-#ifdef SETUID
- ruid = getuid();
- euid = geteuid();
- seteuid(ruid);
-#endif
-
while (optind < argc)
{
nextarg = argv[optind++];
@@ -1118,7 +1107,7 @@ restore_sigs()
* 1 for success and 0 for failure.
*/
int
-make_cat_file (path, man_file, cat_file, manid)
+make_cat_file (path, man_file, cat_file)
register char *path;
register char *man_file;
register char *cat_file;
@@ -1159,29 +1148,16 @@ make_cat_file (path, man_file, cat_file, manid)
if (debug)
fprintf (stderr, "\ntrying command: %s\n", command);
else {
-
-#ifdef SETUID
- if (manid)
- seteuid(ruid);
-#endif
if ((pp = popen(command, "r")) == NULL) {
s = errno;
fprintf(stderr, "Failed.\n");
errno = s;
perror("popen");
-#ifdef SETUID
- if (manid)
- seteuid(euid);
-#endif
unlink(temp);
restore_sigs();
fclose(fp);
return 0;
}
-#ifdef SETUID
- if (manid)
- seteuid(euid);
-#endif
f = 0;
while ((s = getc(pp)) != EOF) {
@@ -1317,43 +1293,7 @@ format_and_display (path, man_file, cat_file)
}
else
{
-
-#ifdef SETUID
- seteuid(euid);
- found = make_cat_file (path, man_file, cat_file, 1);
- seteuid(ruid);
-
- if (!found)
- {
- /* Try again as real user - see note below.
- By running with
- effective group (user) ID == real group (user) ID
- except for the call above, I believe the problems
- of reading private man pages is avoided. */
- found = make_cat_file (path, man_file, cat_file, 0);
- }
-#else
- found = make_cat_file (path, man_file, cat_file, 0);
-#endif
-#ifdef SECURE_MAN_UID
- if (!found)
- {
- /*
- * Try again as real user. Note that for private
- * man pages, we won't even get this far unless the
- * effective user can read the real user's man page
- * source. Also, if we are trying to find all the
- * man pages, this will probably make it impossible
- * to make cat files in the system directories if
- * the real user's man directories are searched
- * first, because there's no way to undo this (is
- * there?). Yikes, am I missing something obvious?
- */
- setuid (getuid ());
-
- found = make_cat_file (path, man_file, cat_file, 0);
- }
-#endif
+ found = make_cat_file (path, man_file, cat_file);
if (found)
{
/*
OpenPOWER on IntegriCloud