- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The ORM has nothing to do with this. The programming error would have been the exact same WTF even if it had been written in raw SQL:
Admin
Great. The only thing missing is some obscure piece of regex and the trifecta is complete.
Admin
Admin
This is a great example of using failsafes - if your authentication ever fails, you can still safely access all of your data!
Admin
Admin
No, it would be requestUser = User.makeInvalidUser(), and it would return a subclass of User that overrode the method isAuthenticated to return false. Or it could even be a special guest user that exists but simply has no permissions.
Admin
Thanks Obama!
Admin
Admin
I took the hard drive out of a PC whose backlight burnt out but still had Windows XP working when an external monitor was attached.
I used a USB-to-SATA cable to connect the hard drive to a PC running Windows 7.
I opened Windows Explorer, selected a bunch of folders, ctrl-c, explored to a folder on the internal drive of the new PC, ctrl-v.
Windows Explorer told me about 30 times that it couldn't copy files because the filenames were too long. Sometimes it showed part of the base filename but it didn't show the entire path. Windows suggested that I change the filename, but didn't provide any button or edit box to do so, just skip or cancel or maybe repeat the fail without change. Sometimes I could guess where the original files were. I didn't handwrite a complete list. Well, that was yesterday. Today is worse.
Today I happened to look at a folder where Windows Explorer did copy files to. A folder where Windows Explorer did not complain about invalid filenames or inability to copy files. A folder where Windows Explorer pretended to succeed.
Today I noticed that some filenames differed from the originals.
ctrl-c / ctrl-v? In Windows 7? Just say no.
Admin
Happened into a similar feature at the university some 15 or so years ago.
There were old macs using some text terminal software to connect to a system named LADOK, a system which stored all information on completed and ongoing courses. These terminals were available to any student (well really anyone at all) in case you wanted to check your grades for that Haskell introduction course.
To retrieve your information, you entered your 10-digit personal number, similar to social security number I guess, only that the 6 first digits are your birth date. By substituting the last four digits with spaces you could enter any date and retrieve a list of students born on that date, their full personal numbers and their grades. Can't recall if it "only" reported students at the local university or if it was for the whole of Sweden.
Admin
It's a classic scenario. They had correctly functioning code without the check on whether the user is null. Then someone entered a non existing user name and the system gave a NullPointerException. A junior developer was told to fix the error and did by checking for null first.
Admin
Buffalo buffalo buffalo?
Admin
Probably just tested with a few users and yep it only showed their data so ... Then our WTF guy decided to use the webservice directly rather than go through the page (which might enforce login at the website level) and didn't use it "correctly". A lot of edge cases never get tested at a lot of places because "it will never happen".
Admin
Admin
Admin
Easy to fix:
if (requestUser == null) throw new SecurityException("Nice try, smartass!");
Bonus points as SecurityExceptions are logged by the App Server.
Admin
Unfortunately, sometimes that's all you want in these OOP languages, and so you end up creating some terrible classes.
Admin
Something something akismet. Suscipere. Frist? First? Fstir?
Admin
Well I don't see what the big problem is it's a one line fix.