[BlueOnyx:14740] Re: Office365 need MX record priority 0

Michael Stauber mstauber at blueonyx.it
Sun Feb 23 21:44:39 -05 2014


Hi Ernie,

I'll look into the ability to add SRV records, too. The trouble is
finding a good regular expression that filters out what's allowed for a
SRV record and what not.

> Wasn't the Apple bug a code merge typto thing where are line got entered
> twice in the source? I read something like that on Slashdot.

Yes. It was very lazy coding, but still bloody obvious. You can do "if -
then" loops like this:

if ($a == $b) {
	goto fail;
}
if ($x == $y) {
	goto otherfail;
}

Which is pretty readable and the brackets make it clear which condition
starts and end where.

But there is also the lazy way, which "the cool kids" use:

if ($a == $b)
	goto fail;
if ($x == $y)
	goto otherfail;

Spotted the difference? No brackets. You don't have to use curly
brackets and some people think without brackets the code is "cleaner",
because it's less typing.

Now what Apple did was similar to this:

if ($a == $b)
	goto fail;
	goto fail;
if ($x == $y)
	goto otherfail;

Which - if you use brackets - translates to this code:

if ($a == $b) {
	goto fail;
}
goto fail;
if ($x == $y) {
	goto othefail;
}

The Apple code was supposed to evaluate various conditions. But after
one of the conditions and due to the double "goto fail;" line it would
always bugger out. Which resulted in invalid certificates being trusted.

In the BlueOnyx code we also have some of this "cool kid" code from the
Cobalt days. Not all of the legacy stuff is that way, but some is.
Whenever I work on one of the old stuff I try to fix it while I'm at it.
Adding the curly brackets and fixing the code indention.

In my opinion it's like this: Without the curly brackets the code is a
lot harder to read and with more complicated code you can easily miss
that one conditional block was supposed to end and regular code that's
outside the condition continues.

Throw in a an unintended indention change (because you use a different
editor than the file was created with) and without curly brackets it's
suddenly a whole lot less clear if that follow up line was supposed to
be inside or outside of the conditional clause.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list