5th Underhanded C Contest Now Open
Xcott Craver writes "The next Underhanded C Contest has begun, with a deadline of March 1st. The object of the contest is to write short, readable, clear and innocent C code that somehow commits an evil act. This year's challenge: write a luggage routing program that mysteriously misroutes a customer's bag if a check-in clerk places just the right kind of text in a comment field. The prize is a gift certificate to ThinkGeek.com."
This year's challenge: write a luggage routing program that mysteriously misroutes a customer's bag if a check-in clerk places just the right kind of text in a comment field.
All participants will also receive complimentary cavity-searches at airport checkpoints.
#fuckbeta #iamslashdot #dicemustdie
Yes, because no one but a C programmer could ever do such a thing. Fuck you.
Someone who works at any major airline can just submit the real production code they use for luggage routing and win the contest for sure!
| This year's challenge: write a luggage routing program that mysteriously misroutes a customer's bag if a check-in clerk places just the right kind of text in a comment field.
What, we actually need to write code for something that happens by nature?
This year's challenge: write a luggage routing program that mysteriously misroutes a customer's bag if a check-in clerk places just the right kind of text in a comment field.
Eh, why re-invent the wheel? The software already in use does a good enough job of that already.
Public Static String default_Address = "1600 Pennsylvania Ave NW, Washington, DC 20500, USA" --- hide this somewhere
Private Sub Void Route_Bagggage(bag b)
{
if (comment.text == NULL)
{
b.destination = default_Address
}
else
{
b.destination = comment.text
}
}
Or do I have to make it slightly more deceptive?
They wrote the right software for Denver International's baggage handling system, but just a tad too soon and in the wrong place!
It seems like this has already been done and is in use at airports worldwide.
I don't have the time for something like this, but it seems to me a good possibility would be to have all of your inputs that the clerk fills out be contiguous in memory, including the destination, have the algorithm to figure out what destination to go to scan through the whole destination string looking for matches (rather than looking for an exact match) and taking the last one it finds, and have a broken bounds check for the length of that string so that the algorithm looks into the comments section as well.
So, for example, if the clerk fills out the destination as "LAX" but writes in the comments section, "Do not confuse his bags with those owned by CID who is also going to a different final destination; they're very similar looking.", the bags would be routed to Cedar Rapids (CID) instead of Los Angeles (LAX).
As it says in the Constitution, Lenin is in my shower.
I've got this nailed. But do you have to know in advance the mystery input combo? I could never figure that out before I throw it over to QA.
Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
a luggage routing program that mysteriously misroutes a customer's bag
sounds like Delta is looking for new programmers
IOCC rocks!
korn.c is a good example, probably one of the best one-liner programs I have seen.
Hey thanks, Kilgore. Way to out yourself as an AC troll.
Tic-Tac-Toe, Global Thermonuclear War, and relationships all have the same winning move.
Way to out yourself as an AC troll.
You just figured this out? He's been posting as an AC troll for ages.
"write short, readable, clear and innocent C code"
1. None of the above adjectives apply to C.
See, thats why its a contest. It has nothing to do with the scenario.
Well, that's the challenge. The misrouting part is easy.
(I'm only partly kidding. :P )
I've read the entire blog, and I must say, I'm impressed. Very impressed. Very, very impressed.
The person who writes the criteria knows what he's/she's writing about.
And the winners who submit the results are really, really good.
I. C. Weener, we seem to have misplaced your luggage.
I was going to say, don't forget Perl programmers, but then I remembered the legibility requirement.
If you manage to get this into the GNU/Linux Kernel, you get a job at the NSA.
Write short, readable, perfectly innocent looking C code, that somehow commits an evil act under certain circumstances.
After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
The point of something like "Underhanded C" would be more about hiding something from a code review than GDB. That code would easily trigger red flags in a code review...
"There is more worth loving than we have strength to love." - Brian Jay Stanley
The true "Underhanded" program would be one that was perfectly readable, so readable in fact that you totally overlook the sneaky thing it was doing because what you think it's doing seems so clear.
The ObsfuC contest is all about code that even after staring you can't tell what the heck is going on.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Care to explain what it does? I read the hints and still have no clue what 'unix' is, and gcc and cc on my machine give compilation errors.
#define unix 1
'unix' is a preprocessor constant:
(It should be defined like that on unix/linux systems)
Another important thing to know is how the compiler gets the address of an array element. Consider the following piece of code:
The two printf lines will do exactly the same (output is '1', the second array element). That's beceause the compiler just takes the address of the array 'a' and adds an offset (1) to get the address of the actual array element. The compiler doesn't care which one is the offset, and which is the base address.
Once you got that, the rest of the code should become clear sooner or later. The actual output of the program is just 'unix' followed by a newline (012 octal). Don't get confused... the 'un' part for example is from "fun" ;-)
I hope I gave enough hints...
ps: sorry for the missing 'C' in the previous comment
Depending on the number of working entries, I think this guy will have to update his song.
But years before the contest.
http://en.wikipedia.org/wiki/Denver_International_Airport#Automated_baggage_system
http://users.csc.calpoly.edu/~dstearns/SchlohProject/problems.html
The second article sounds familiar. All the warning signs of a risky project failure were there, but no one seemed to know it or pay attention.
putting the 'B' in LGBTQ+
I have a program, actually a large system, that sends boxes to different areas in warehouse depending from various aspects. Sending/transfer is done by conveyor belts and sometimes even with robots. Boxes are actual physical boxes containing food items.
It has a little defect though which I've been unable to track down. Sometimes when it tries to send box to place A the box is actually found in place B but the UI tells that it is located in places C and D, which of course is impossibility.
Unfortunately it is not written in C. Otherwise it could a clear winner with couple of minor modifications.
You don't know what you don't know.
'unix' is a preprocessor constant:
(It should be defined like that on unix/linux systems)
Ah, that's exactly what I was missing. Thanks!
http://otbits.blogspot.com/2009/06/ioccc-best-one-liner.html
It prints out the word "unix".
The Perl programmers weren't forgotten, just implicitly passed in.
This is way cool, yes. But I miss the obfuscated C contest which was also way cool eg in terms of discovering legal features of the language that probably should never get used LOL. What happened to it?
Doesn't the example on the contest page qualify as Useless Use of Cat?
i.e., shouldn't this line: ./lug UA129086 - - -
cat luggage.dat |
be this: ./lug UA129086 - - - http://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat
A kioll once bit my sister...
Isn't it obvious? It prints the string "unix\n".
This sig cannot be proven true.
You all remember London Heathrow Terminal 5 don't you?!
if (strcmp(entry->description, "lose luggage") == 0) { loseLuggage(entry); } (It's been awhile since I've done anything vaguely C.)
On vit, on code et puis on meurt.
I must be new here.
Tic-Tac-Toe, Global Thermonuclear War, and relationships all have the same winning move.
If the code has a comment field for special handling, you wouldn't need much to do this. The biggest problem would be to make it so that somebody can't correlate bad handling to the comment. You might want to have a 'bad handling' string that varies from hour to hour, one that is displayed as part of a 'quote of the moment'.
Never done this myself, but people have inserted backdoors into Unix V7 kernels they compiled by replacing a "if (userid == 0)" with a "if (userid = 0)" check. I assume they are looking for a more sophisticated version of that trick.
I've abandoned my search for truth; now I'm just looking for some useful delusions.
I am the winner of the previous underhanded C contest. If anyone is interested, I wrote up a description of my entry on my blog here: http://notanumber.net/archives/54/underhanded-c-the-leaky-redaction
It was a fun contest to enter and now I can shop at thinkgeek for silly gadgets without feeling guitly :)
http://notanumber.net/
So... make your OWN contest in YOUR language of choice? Fuck YOU for thinking YOUR opinion is what the world revolves around ass-hat.
Well, you must have known supporting religious beliefs will earn you bad karma
Who here has put underhanded code in released products?
I admit to adding and concealing the flight cam easter egg in Star Wars: Knights of the Old Rebublic. It wasn't nearly as clever as the contest entries, and it would be impossible to claim innocence if I was caught, but I enabled the "debug" cam using a generic-sounding external variable, put the code inside an "#ifndef _DEBUG" block, added a comment to describe the code as some boring debug message thing (hardly worth looking at), and had a little loop to decode the "Punch it, Chewie!" message to that the string wouldn't show up in the executable.
You’re joking, but you’re correct. The challenge is making the program ever do what it’s supposed to. It’s deceptively simple... then you start looking at it and you realise it’s more complicated than you thought. Making the 2nd leg of a non-direct flight go away when the 1st leg was superseded by a newer entry, for example.
Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
Hey oodaloop... April fools!
Yours In Ashgabat,
Kilgore Trout
Here is me, a troll, astounded at my superiors' troll skill. It seems that I still have many level ups more to go...
lurk moar.
And in other news: we learn that C was actually invented during the Underhanded Programming Language Contest of 1972.
As opposed to the current system that does it at random? If you come up with a system that ONLY does it when malicious text is written in the comment field, the government wants to talk with you. They paid $500 per LINE for a baggage-routing system that never worked. It was finally abandoned after half a billion was sunk into it.