The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Oh, Muphry, do you know no bounds?

Last post 01-16-2009 6:44 PM by Spectre. 25 replies.
Page 1 of 1 (26 items)
Sort Posts: Previous Next
  • 01-13-2009 12:33 AM

    Oh, Muphry, do you know no bounds?

    I was reading the list of the top 25 most dangerous software programming errors according to SANS when I linked off to the CWE website and read this article that contains the code shown below.
     
    int VerifyAdmin(String password) {
    if (passwd.Equals("68af404b513073584c4b6f22b6c63e6b")) {
    return(0);
    } //Diagnostic Mode
    return(1);
    }
     
    Software progamming error #26 (the syntax error).

     

  • 01-13-2009 1:30 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    communist_goatboy:

    I was reading the list of the top 25 most dangerous software programming errors according to SANS when I linked off to the CWE website and read this article that contains the code shown below.
     
    int VerifyAdmin(String password) {
    if (passwd.Equals("68af404b513073584c4b6f22b6c63e6b")) {
    return(0);
    } //Diagnostic Mode
    return(1);
    }
     
    Software progamming error #26 (the syntax error).

     

    Maybe it's just following the POSIX standard of returning zero for success and non-zero for error?  So if it returns zero, that means it successfully verified your admin status.  If it returns 1, that means it failed.
    </devil'sadvocate>

    (USER WAS BANNED FOR THIS POST)


  • 01-13-2009 1:42 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    DaveK:
    Maybe it's just following the POSIX standard of returning zero for success and non-zero for error?  So if it returns zero, that means it successfully verified your admin status.  If it returns 1, that means it failed.
    </devil'sadvocate>

    Check the C++ example, I don't think that's their plan (Either that or the C++ example is the wtf instead).

     

    Maybe they just really don't want  anyone logging in with that specific password... a blacklist password system rather than whitelist, ingenious! =P

     

  • 01-13-2009 1:48 AM In reply to

    • MHolt
    • Not Ranked
    • Joined on 06-07-2008
    • Posts 15

    Re: Oh, Muphry, do you know no bounds?

    DaveK:

    communist_goatboy:

    I was reading the list of the top 25 most dangerous software programming errors according to SANS when I linked off to the CWE website and read this article that contains the code shown below.
     
    int VerifyAdmin(String password) {
    if (passwd.Equals("68af404b513073584c4b6f22b6c63e6b")) {
    return(0);
    } //Diagnostic Mode
    return(1);
    }
     
    Software progamming error #26 (the syntax error).

     

    Maybe it's just following the POSIX standard of returning zero for success and non-zero for error?  So if it returns zero, that means it successfully verified your admin status.  If it returns 1, that means it failed.
    </devil'sadvocate>
    I think, just maybe, he might be referring to the fact that the equals() method is called equals with a lower-case e, and not Equals(). Java is afterall a case-sensitive language.
    Minor wtf though if that's it.
  • 01-13-2009 2:41 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    MHolt:
    DaveK:
    communist_goatboy:

    int VerifyAdmin(String password) {
    if (passwd.Equals("68af404b513073584c4b6f22b6c63e6b")) {
    return(0);
    }
    //Diagnostic Mode
    return(1);
    }
    Maybe it's just following the POSIX standard of returning zero for success and non-zero for error?  So if it returns zero, that means it successfully verified your admin status.  If it returns 1, that means it failed.
    </devil'sadvocate>
    I think, just maybe, he might be referring to the fact that the equals() method is called equals with a lower-case e, and not Equals(). Java is afterall a case-sensitive language.
    Minor wtf though if that's it.
    Or perhaps to the fact that passwd isn't defined anywhere (and password isn't used)?
  • 01-13-2009 3:18 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    vyznev:
    Or perhaps to the fact that passwd isn't defined anywhere (and password isn't used)?

    "passwd" is the global variable that you have to use. The "password" parameter only exists to confuse crackers. This is a well-known security pattern
    It's... Monkey Piston's Frying Circle!
    Filed under:
  • 01-13-2009 7:47 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    bjolling:

    vyznev:
    Or perhaps to the fact that passwd isn't defined anywhere (and password isn't used)?

    "passwd" is the global variable that you have to use. The "password" parameter only exists to confuse crackers. This is a well-known security pattern
    Ahh yes, the anti-pattern pattern.  I try to live by it!
    <somethingwitty />
  • 01-13-2009 8:19 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    bjolling:

    vyznev:
    Or perhaps to the fact that passwd isn't defined anywhere (and password isn't used)?

    "passwd" is the global variable that you have to use. The "password" parameter only exists to confuse crackers. This is a well-known security pattern
    My mind is blown
    SpectateSwamp exposing aliens. Obviously the World needs SSDS


    [10:07] <fatdog> so from now on.. be sure to wear nice clean underwear
    [10:07] <mps> fatdog: That is simply not going to happen
    Filed under:
  • 01-13-2009 8:24 AM In reply to

    • tster
    • Top 10 Contributor
    • Joined on 04-11-2006
    • Natick, MA
    • Posts 1,765

    Re: Oh, Muphry, do you know no bounds?

    MHolt:
    DaveK:

    communist_goatboy:

    I was reading the list of the top 25 most dangerous software programming errors according to SANS when I linked off to the CWE website and read this article that contains the code shown below.
     
    int VerifyAdmin(String password) {
    if (passwd.Equals("68af404b513073584c4b6f22b6c63e6b")) {
    return(0);
    } //Diagnostic Mode
    return(1);
    }
     
    Software progamming error #26 (the syntax error).

     

    Maybe it's just following the POSIX standard of returning zero for success and non-zero for error?  So if it returns zero, that means it successfully verified your admin status.  If it returns 1, that means it failed.
    </devil'sadvocate>
    I think, just maybe, he might be referring to the fact that the equals() method is called equals with a lower-case e, and not Equals(). Java is afterall a case-sensitive language.
    Minor wtf though if that's it.
     

    Perhaps this is C# where it is "Equals".

    The pig go. Go is to the fountain. The pig put foot. Grunt. Foot in what? ketchup. The dove fly. Fly is in sky. The dove drop something. The something on the pig. The pig disgusting... see bio for the earth shattering ending.
  • 01-13-2009 8:32 AM In reply to

    • PhillS
    • Top 200 Contributor
    • Joined on 03-07-2006
    • Colchester, UK
    • Posts 189

    Re: Oh, Muphry, do you know no bounds?

     

    tster:
    Perhaps this is C# where it is "Equals".

    On the site it's listed as a Java example.

    Not quite sure about their use of brackets around the return value - it's unnecessary. Or is that just a C++ habit translated to Java?

     

  • 01-13-2009 8:36 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    PhillS:

     

    tster:
    Perhaps this is C# where it is "Equals".

    On the site it's listed as a Java example.

    Not quite sure about their use of brackets around the return value - it's unnecessary. Or is that just a C++ habit translated to Java?

     

    In Java, the parentheses around the return value are purely optional and serve no actual purpose (some folks just like em)

     

    If you must burn our flag, please wrap yourself in it first!
  • 01-13-2009 8:48 AM In reply to

    • PJH
    • Top 10 Contributor
    • Joined on 02-14-2007
    • Newcastle, UK
    • Posts 1,256

    Re: Oh, Muphry, do you know no bounds?

    snoofle:

    PhillS:

    On the site it's listed as a Java example.

    Not quite sure about their use of brackets around the return value - it's unnecessary. Or is that just a C++ habit translated to Java?

    In Java, the parentheses around the return value are purely optional and serve no actual purpose

    Not that different to C++ in that respect, then.
    Abstinence makes the Church grow fondlers.

    - unknown
  • 01-13-2009 8:54 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    snoofle:

    In Java, the parentheses around the return value are purely optional and serve no actual purpose (some folks just like em)

    Same for C++; I don't really remember any language where they are mandatory.

    Let's start a holy war about whether parentheses are prettier than no parentheses.

    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
    Filed under: ,
  • 01-13-2009 9:11 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    Spectre:
    Let's start a holy war about whether parentheses are prettier than no parentheses.
    Don't bother.  The Ruby community have that war with themselves every few months. Or maybe it's just one long war with surges of activity and periods of relative peace, like the Israeli/Palestinian conflict.

  • 01-13-2009 9:34 AM In reply to

    • tster
    • Top 10 Contributor
    • Joined on 04-11-2006
    • Natick, MA
    • Posts 1,765

    Re: Oh, Muphry, do you know no bounds?

    PhillS:

     

    tster:
    Perhaps this is C# where it is "Equals".

    On the site it's listed as a Java example.

     

    ah.  I tried to look at the site but it wasn't loading this morning when I tried.

    The pig go. Go is to the fountain. The pig put foot. Grunt. Foot in what? ketchup. The dove fly. Fly is in sky. The dove drop something. The something on the pig. The pig disgusting... see bio for the earth shattering ending.
  • 01-13-2009 3:35 PM In reply to

    Re: Oh, Muphry, do you know no bounds?

    belgariontheking:

    bjolling:

    vyznev:
    Or perhaps to the fact that passwd isn't defined anywhere (and password isn't used)?

    "passwd" is the global variable that you have to use. The "password" parameter only exists to confuse crackers. This is a well-known security pattern
    My mind is blown
    That means the pattern worked.
  • 01-13-2009 6:29 PM In reply to

    Re: Oh, Murphy, do you know no bounds?

    Of course Murphy's law is infinitely recursive.  It acts upon itself until entropy has reached a maximum.

    Witness the title of the original post.  (It took me a while to notice it.)

    My Signature! Get your own!
  • 01-13-2009 7:36 PM In reply to

    • lolwtf
    • Top 100 Contributor
    • Joined on 04-02-2008
    • (null)
    • Posts 303

    Re: Oh, Murphy, do you know no bounds?

    Muphry's Law is not Murphy's Law.
    (null)
  • 01-14-2009 8:56 AM In reply to

    Re: Oh, Muphry, do you know no bounds?

    alegr:

    belgariontheking:

    bjolling:

    vyznev:
    Or perhaps to the fact that passwd isn't defined anywhere (and password isn't used)?

    "passwd" is the global variable that you have to use. The "password" parameter only exists to confuse crackers. This is a well-known security pattern
    My mind is blown
    That means the pattern worked.
    Indeed, after such a statement I could have posted my credit card number + expiry date and BTK still wouldn't have been able to use it. I call it "secure commenting on a public entity" or "SCOPE". It'll be big once I get this approved as an ISO standard
    It's... Monkey Piston's Frying Circle!
    Filed under:
  • 01-14-2009 9:49 AM In reply to

    • pscs
    • Top 500 Contributor
    • Joined on 10-30-2007
    • Posts 67

    Re: Oh, Muphry, do you know no bounds?

    communist_goatboy:
    Oh, Muphry, do you know no bounds?

    communist_goatboy:
    Software progamming error #26 (the syntax error).
     

    Apparently not...

  • 01-14-2009 9:57 AM In reply to

    Re: Oh, Murphy, do you know no bounds?

    lolwtf:
     
    Qwerty:

    Of course Murphy's law is infinitely recursive.  It acts upon itself until entropy has reached a maximum.

    Witness the title of the original post.  (It took me a while to notice it.)

    Muphry's Law is not Murphy's Law.

    And besides that, Murphy's law isn't recursive.  To wit:

    Murphy's law:
    Anything that can go wrong, will go wrong

    DaveK's Oh-no-you-don't-get-away-that-easily corollary to Murphy's law:
    Except Murphy's law.

    (USER WAS BANNED FOR THIS POST)


  • 01-15-2009 3:55 PM In reply to

    • dtech
    • Top 50 Contributor
    • Joined on 11-13-2007
    • Utrecht, Netherlands
    • Posts 623

    Re: Oh, Murphy, do you know no bounds?

    DaveK:

    Murphy's law:
    Anything that can go wrong, will go wrong

    DaveK's Oh-no-you-don't-get-away-that-easily corollary to Murphy's law:
    Except Murphy's law.

     

    How the heck can murphy's law go wrong?

    NerdTests.com says I'm a Cool Nerd King.  Click here to take the Nerd Test, get nerdy images and jokes, and write on the nerd forum!
  • 01-16-2009 4:52 AM In reply to

    • Zecc
    • Top 50 Contributor
    • Joined on 06-12-2007
    • Location, Location, Location
    • Posts 658

    Re: Oh, Murphy, do you know no bounds?

    dtech:

    DaveK:

    Murphy's law:
    Anything that can go wrong, will go wrong

    DaveK's Oh-no-you-don't-get-away-that-easily corollary to Murphy's law:
    Except Murphy's law.

     

    How the heck can murphy's law go wrong?

    Exactly. Therefore Murphy's Law doesn't apply to itself: it isn't recursive, like DaveK said.
    If mixed metaphors were illegal, I'd be having an indigestion.
    typeof NaN == 'number'
  • 01-16-2009 5:57 PM In reply to

    • dtech
    • Top 50 Contributor
    • Joined on 11-13-2007
    • Utrecht, Netherlands
    • Posts 623

    Re: Oh, Murphy, do you know no bounds?

    Zecc:
    Exactly. Therefore Murphy's Law doesn't apply to itself: it isn't recursive, like DaveK said.
     

    Murphy's law is recursive. Logic:

    Mx = Murphy's Law for some object x
    cx = x can go wrong
    wx = x will go wrong

    We have property Mx that states:  cx → wx        (or
    if property cx then property wx       or
    if something can wrong it will go wrong)

    So:
    (cx ∧ Mx) → wx   (if something can go wrong and Murphy's law is correct for that something that something will go wrong)

    Note that Mx doesn't say anything about the case ¬cx

    If we replace the x with Murphy's law (or anything else that can't go wrong) Murphy's law is still valid for that thing, since Murphy's law doens't say anything about that thing.

    NerdTests.com says I'm a Cool Nerd King.  Click here to take the Nerd Test, get nerdy images and jokes, and write on the nerd forum!
  • 01-16-2009 6:12 PM In reply to

    Re: Oh, Murphy, do you know no bounds?

    dtech:

    If we replace the x with Murphy's law (or anything else that can't go wrong) Murphy's law is still valid for that thing, since Murphy's law doens't say anything about that thing.

    But Murphy's law can go wrong, can't it?
    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
    Filed under:
  • 01-16-2009 6:44 PM In reply to

    Re: Oh, Murphy, do you know no bounds?

    Now that I think of it, if it can go wrong, it most certainly does not apply to itself. If it can go wrong and applies to itself, then it will go wrong, which means it doesn't apply to anything, hence a contradiction.
    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
    Filed under: ,
Page 1 of 1 (26 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems