lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BANLkTi=K9SNVsDNShdneY1k4-3jCND9M0Q@mail.gmail.com>
Date:	Wed, 15 Jun 2011 12:51:16 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Andy Lutomirski <luto@....edu>
Cc:	Olivier Galibert <galibert@...ox.com>,
	Denys Vlasenko <vda.linux@...glemail.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Linux 3.0-rc3

On Wed, Jun 15, 2011 at 12:44 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> I really don't see why you should ever parse a version number.

Let me modulate that: I do see why you would ever say "is this version
xyz" - but then you don't have to be very smart about parsing things,
because a failure to parse just means "no". So there is never any case
where a failure to parse something means that you cannot answer the
question, and failure to parse it never becomes a failure for the
program itself.

So doing

  if (!strncmp(version, "v2.4", 4))
     workaround_for_old_version = true;

is valid. But only if you really have special code for those specific
old versions that you know, and have normal code for everything else.

So if you then confinue with

  else if (!strncmp(version, "v2.6", 4))
     error("unknown version");

then you're just being an ass.

Why? At that point you're no longer correcting for known bugs or
mis-features, at that point you're just being stupid and parsing the
version string for no good reason.

So "checking for _particular_ old versions that you know about" is
fine. Checking for versions you _don't_ know about or understand is
stupid.

                            Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ