From: Daniel Phillips <news-innominate.list.linux.kernel@innominate.de>
To: linux-kernel@vger.kernel.org
Cc: David Relson <relson@osagesoftware.com>,
Peter Samuelson <peter@cadcamlab.org>
Subject: Re: Modprobe local root exploit
Date: Tue, 14 Nov 2000 15:23:50 +0100 [thread overview]
Message-ID: <news2mail-3A114AF6.44AA8032@innominate.de> (raw)
In-Reply-To: <14864.5656.706778.275865@ns.caldera.de> <Pine.LNX.4.21.0011131744100.594-100000@toy.mandrakesoft.com> <14864.6812.849398.988598@ns.caldera.de> <20001113134630.C18203@wire.cadcamlab.org> <news2mail-3A112225.F29226B6@innominate.de>
On Tue, 14 Nov 2000, David Relson wrote:
> At 06:29 AM 11/14/00, Daniel Phillips wrote:
>
> >Heading in the right direction, but this is equivalent to:
> >
> > if (isalnum(*p) && *p != '-' && *p != '_') return -EINVAL;
> >
> >which is faster, smaller and easier to read.
>
> Almost right, but you forgot to negate isalnum(). Should be:
>
> if (!isalnum(*p) && *p != '-' && *p != '_') return -EINVAL;
>
> or
> if (! (isalnum(*p) || *p == '-' || *p == '_')) return -EINVAL;
>
> I think I prefer the older version with "continue" as I don't have to think
> about all the negatives ("!"), i.e.
>
> for ( ... )
> {
> if ( isalnum(*p) || *p == '-' || *p == '_' )
> continue;
> return -EINVAL;
> }
>
I reserve the right to make coding errors, thanks for not letting it get
written into history :-)
How about:
for ( ... ) if (!isalnum(*p) && !strchr("-_", *p)) return -EINVAL;
--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-14 14:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-13 14:37 Gregory Maxwell
2000-11-13 16:26 ` Torsten Duwe
2000-11-13 16:44 ` Francis Galiegue
2000-11-13 16:45 ` Torsten Duwe
2000-11-13 16:56 ` Chris Evans
2000-11-13 17:21 ` Jan Dvorak
2000-11-14 1:35 ` Horst von Brand
2000-11-13 18:11 ` Torsten Duwe
2000-11-14 5:02 ` Peter Samuelson
2000-11-14 5:50 ` Keith Owens
2000-11-14 9:19 ` Florian Weimer
2000-11-14 10:42 ` Malcolm Beattie
2000-11-14 10:54 ` Jakub Jelinek
2000-11-14 11:58 ` Chris Evans
2000-11-14 10:58 ` Keith Owens
2000-11-14 12:28 ` Nick Holloway
2000-11-14 14:01 ` David Woodhouse
2000-11-13 19:46 ` Peter Samuelson
2000-11-14 11:29 ` Daniel Phillips
2000-11-14 14:23 ` Daniel Phillips [this message]
2000-11-14 16:25 ` David Relson
2000-11-15 4:09 ` Horst von Brand
2000-11-16 5:22 ` Alan Cox
2000-11-16 6:04 ` H. Peter Anvin
2000-11-16 6:14 ` Keith Owens
2000-11-16 6:16 ` H. Peter Anvin
2000-11-16 14:12 ` Torsten Duwe
2000-11-16 15:07 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=news2mail-3A114AF6.44AA8032@innominate.de \
--to=news-innominate.list.linux.kernel@innominate.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@cadcamlab.org \
--cc=phillips@innominate.de \
--cc=relson@osagesoftware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®