Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 2002 23:01:10 +0100
From:      Alexander Langer <alex@big.endian.de>
To:        Mike Silbersack <silby@silby.com>
Cc:        "Jacques A. Vidrine" <nectar@FreeBSD.org>, Nate Lawson <njl@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/bin/sleep sleep.c
Message-ID:  <20021113220110.GI94076@fump.kawo2.rwth-aachen.de>
In-Reply-To: <Pine.BSF.4.44.0211131557510.36295-100000@niwun.pair.com>
References:  <20021113204941.GF29284@madman.nectar.cc> <Pine.BSF.4.44.0211131557510.36295-100000@niwun.pair.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> That's not a major problem, we can work around it with ACLs.  There's the
> slight downside that we'll have to require extended attributes to be
> available for 5.0 / partitions, but I think it's worth the tradeoff.

Well, hehe :-)  That's all true, but I can't see anything about 
obfuscated C here.  I think that of the commit at least the removing
of the getopt() call was an improvement.

One the one hand there are no options to sleep, and getopt() was abused
to find out if the argument is valid or invalid (negative):

alex@zerogravity ~ $ sleep -19
sleep: illegal option -- 1
usage: sleep seconds

On the other hand, you could abuse the "--" flag for getopt, resulting in
different behaviour, due to a further non-negative check in the source-code:

alex@zerogravity ~ $ time sleep -- -19 
sleep -- -19  0.00s user 0.00s system 0% cpu 0.001 total

Anyways, I personally wouldn't have removed the call to strtol(), but
it's not too bad to do some simple maths yourself :)

Alex

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021113220110.GI94076>