Date: Sun, 20 May 2001 16:26:50 -0700 From: Dima Dorfman <dima@unixfreak.org> To: hackers@freebsd.org Subject: Re: De-setgid-ifying ipcs(1) Message-ID: <20010520232650.AE7593E0B@bazooka.unixfreak.org> In-Reply-To: <20010518014032.N7118@superconductor.rush.net>; from bright@rush.net on "Fri, 18 May 2001 01:40:33 -0400"
index | next in thread | previous in thread | raw e-mail
Alfred Perlstein <bright@rush.net> writes:
> Probably not the commentary you're looking for, however the
> getopt parsing shouldn't be done like this:
Some comments is usually better than no comments: to have noticed this
problem, you had to have at least skimmed through the other (kernel)
parts, so I know I didn't do anything *too* evil :-).
> > - while ((i = getopt(argc, argv, "MmQqSsabC:cN:optT")) != -1)
> > + use_sysctl = 1;
> > + while ((i = getopt(argc, argv, "MmQqSsabC:cN:optTy")) != -1)
> > switch (i) {
> > case 'M':
> > display = SHMTOTAL;
> > @@ -184,39 +187,45 @@
> > case 't':
> > option |= TIME;
> > break;
> > + case 'y':
> > + use_sysctl = !use_sysctl;
> > + break;
> > default:
> > usage();
> > }
>
> Multiple -y options will invert the sense of the flag right?
>
> Might as well inialize it to 1 in the DATA segment and replace
> !use_sysctl with just 0.
Point taken. I've done as you suggested in the patch I just posted to
-audit for review.
Thanks again,
Dima Dorfman
dima@unixfreak.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010520232650.AE7593E0B>
