Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment My explanation (Score 1) 399

This is bad. The reason is lots of things that use bash put unchecked data into environment variables.

As an example, imagine some cgi wants to test is a string is valid, and somebody wrote a clever bash script that does this check, and reads the string by looking in $INPUT. The cgi takes whatever the user typed on their web form, does setenv("INPUT", text) and then runs the bash script, which uses "$INPUT" at places it wants the text.

No matter how carefully written the bash script is, if the user can type "() { :;}; exploit" into the text field, it will run "exploit". There is no reason for the cgi to test for any syntax errors because that is the job of the bash script!

It seems hard to believe such a bug is possible. It appears that when setting an environment variable, if it is a function, it runs some code that splits the text at semicolons, puts the first section in the environment variable, then runs the rest as shell input! But I can't figure out any reason such code exists. I thought at first it was pasting "export " on the start of the environment line and executing that using the interpreter, but tests show that does not work because it splits at the spaces. And if you add quoting to fix that then it also fixes the semicolon. And it obviously examined the environment variable to see if is a function, because semicolons in non-function ones are handled correctly. So I think bash code might be quite a mess for such a bug to be possible without much more obvious bugs happening...

Comment Re:Quite accurately? (Score 1) 171

The model can give a "quite accurate" expected value, even when wrong. Example (note numbers are completely made up):

Say there is model A which predicts 2.5-2.6% lithium.

Say there is another model B which predicts 2%-8% lithium.

Say in reality there is 1% lithium.

Both models are apprently wrong. But Model A is more "accurate" in making the wrong prediction. Therefore the text in the article is perfectly correct.

Get it?

Comment Re:Empirical Data Trumps Information Theory (Score 1) 211

Actually it will be a lot worse than Venus and due to a different cause in that the sun would actually be irradating many times more energy on it, and possibly even engulfing it in hot plasma. Venus is heated by the insulation of a huge amount of CO2, the Earth with that much CO2 would be equally hot, and Venus without it would be just a tropical Earth. And when the sun expands the CO2 will be irrelevant (I would think the heat would actually make it escape to space), not that that is going to help any.

Comment Re:Powershell (Score 2) 729

Null-terminated strings were considered superior to using a length because they allowed strings to be > 255 bytes long (using 16 bits for the length would allow longer counted strings, but at that time with 4K of memory nobody in their right mind would suggest wasting a byte like that!).

Null-terminated strings also have the nice property that getting the "tail" is a very fast operation, since you just return a pointer to the middle. This meant that searches could return strings, rather than indexes. This then meant that every function that worked on text only needed one argument, a string, rather than two (a string and an index). The savings due to this were pretty significant.

Comment Re:Programming: You're doing it completely wrong (Score 5, Interesting) 120

Actually more often I have seen the opposite: claims the new stuff is going to be faster, the compiler is not smart enough to figure out that they are the same, and thus you should use the new stuff.

There was a coworker who insisted that using C++ std::foreach for loops was faster because "the compiler knows you can't break out of it and thus can optimize the whole thing". I had two objections to this: first of all it would be a really stupid optimizing compiler that could not figure out there are no "break" statements inside the for loop. And second the C++ was still allowed to throw exceptions in both cases.

The other objection I had was that the functors were unreadable.

Yet another objection is my suspicion that the optimization would be far worse on the functors due to the enormous header files of templates they actually used and I expected the optimizer for the simple for loop to have fewer bugs in it. But I did not test this.

Comment Re:Compelled to freely license? (Score 1) 191

Copyright violation conviction results in having to pay monetary damages to the copyright holder, and to cease redistribution of the copyrighted work.

Fulfilling the requirements of the LGPL on new copies in no way is required by, and conversely also does not get you out of, the punishment. Therefore for every possible reason in the book this "viral" idea is false.

Comment Re:more gpl non-sense (Score 0) 191

You are stating a LIE that was written by MicroSoft. Absolutely not what Richard Stallman said.

The GPL does not compel anybody to freely license their product. What it does is make you violate copyright if you include GPL code in that product. The punishment for violating copyright is defined by law as monetary damages and a requirement to STOP distributing (and stopping is the exact opposite of being forced to distribute, you know).

Thanks for proving your ignorance.

Slashdot Top Deals

Retirement means that when someone says "Have a nice day", you actually have a shot at it.

Working...