Removed bitrot.

This commit is contained in:
ru 2004-11-13 17:12:22 +00:00
parent ca2b1b8495
commit c425b99594
4 changed files with 3 additions and 30 deletions

View File

@ -13,7 +13,5 @@ WARNS?= 5
CFLAGS+=-DLAZY_PS
DPADD= ${LIBM} ${LIBKVM}
LDADD= -lm -lkvm
#BINGRP= kmem
#BINMODE=2555
.include <bsd.prog.mk>

View File

@ -171,7 +171,7 @@ main(int argc, char *argv[])
struct winsize ws;
const char *nlistf, *memf;
char *cols;
int all, ch, dropgid, elem, flag, _fmt, i, lineno;
int all, ch, elem, flag, _fmt, i, lineno;
int nentries, nkept, nselectors;
int prtheader, showthreads, wflag, what, xkeep, xkeep_implied;
char errbuf[_POSIX2_LINE_MAX];
@ -196,7 +196,7 @@ main(int argc, char *argv[])
if (argc > 1)
argv[1] = kludge_oldps_options(PS_ARGS, argv[1], argv[2]);
all = dropgid = _fmt = nselectors = optfatal = 0;
all = _fmt = nselectors = optfatal = 0;
prtheader = showthreads = wflag = xkeep_implied = 0;
xkeep = -1; /* Neither -x nor -X. */
init_list(&gidlist, addelem_gid, sizeof(gid_t), "group");
@ -278,14 +278,12 @@ main(int argc, char *argv[])
break;
case 'M':
memf = optarg;
dropgid = 1;
break;
case 'm':
sortby = SORTMEM;
break;
case 'N':
nlistf = optarg;
dropgid = 1;
break;
case 'O':
parsefmt(o1, 1);
@ -423,14 +421,6 @@ main(int argc, char *argv[])
if (xkeep < 0) /* Neither -X nor -x was specified. */
xkeep = xkeep_implied;
/*
* Discard setgid privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
*/
if (dropgid)
setgid(getgid());
kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
if (kd == 0)
errx(1, "%s", errbuf);

View File

@ -7,9 +7,6 @@ WARNS?= 5
DPADD= ${LIBKVM}
LDADD= -lkvm
#BINGRP= kmem
#BINMODE= 2555
LINKS= ${BINDIR}/pkill ${BINDIR}/pgrep
MLINKS= pkill.1 pgrep.1

View File

@ -124,7 +124,7 @@ main(int argc, char **argv)
char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q;
const char *execf, *coref;
int debug_opt;
int i, ch, bestidx, rv, criteria, drop_privs;
int i, ch, bestidx, rv, criteria;
size_t jsz;
void (*action)(struct kinfo_proc *);
struct kinfo_proc *kp;
@ -166,7 +166,6 @@ main(int argc, char **argv)
criteria = 0;
debug_opt = 0;
drop_privs = 0;
execf = coref = _PATH_DEVNULL;
while ((ch = getopt(argc, argv, "DG:M:N:P:U:d:fg:lns:t:u:vx")) != -1)
@ -180,11 +179,9 @@ main(int argc, char **argv)
break;
case 'M':
coref = optarg;
drop_privs = 1;
break;
case 'N':
execf = optarg;
drop_privs = 1;
break;
case 'P':
makelist(&ppidlist, LT_GENERIC, optarg);
@ -245,15 +242,6 @@ main(int argc, char **argv)
if (!criteria)
usage();
/*
* Discard privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
*/
if (drop_privs) {
setgid(getgid());
setuid(getuid());
}
mypid = getpid();
/*