Skip to content
Liquid Egg Product

Liquid Egg Product

  • Home
  • Weaksauce Losers
  • Burning Agony
  • Don’t do this

Don’t do this

Posted on July 16, 2012 By Liquid Egg Product 4 Comments on Don’t do this
Burning Agony, Patently Ineffective

A query that had been used to authenticate users to a website:

SELECT COUNT(PKID_Users) as 'c' FROM Users
WHERE UPPER(Username)='"+this.username.ToUpper()+ "' AND Password='"+this.password+"'
AND Active=1

As an added bonus, the code checked the count to make sure there weren’t multiple rows returned (was there was a chance more than one user could have the same user name?)
Thankfully, I replaced the authentication with something sane quite some time ago.

But geez.

Post navigation

❮ Previous Post: American political stereotypes, in chess terms
Next Post: I don’t mind ❯

4 thoughts on “Don’t do this”

  1. Q says:
    July 19, 2012 at 12:55 am

    I got a C+ in C++ :p

    Reply
  2. Robert says:
    July 24, 2012 at 7:43 pm

    Set the count to zero. I read that in William Gibson’s book! I think it might be relevant. Also relevant is Gibson’s quote: “I’ve spent about as much time writing as most American men my age have spent watching television.”

    Heh!

    Reply
  3. Donnie says:
    August 26, 2012 at 10:33 pm

    @Q: Oh, yeah? Well I got a C++!

    @Robert: Amazingly, setting the count to zero is not a half-bad solution: no one can log in while the security is improved to something not completely laughable.

    Reply
  4. Robert says:
    August 27, 2012 at 2:47 pm

    That’s cool to know, because I read the book about 25 years ago and couldn’t remember exactly what the title referred to. Le Wiki sez:

    “The title of the book, other than being the pseudonym of the main character Bobby Newmark, was also claimed by Gibson to be a word-play on the alleged computer programming term count zero interrupt. According to a frontleaf of the book, in a “count zero interrupt”, an interrupt of a process decrements a counter to zero. The exact quote is “On receiving an interrupt, decrement the counter to zero.” (The term “count zero interrupt” or CZI could be found in the book: Programming The Z80 by Rodnay Zaks, 1982.)”

    Reply

Leave a Reply to Robert Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • 2020 was so bad, we didn’t make a single post
  • Monday Fighter!
  • King Safety
  • So, no rematch?
  • Estimate how much this cost

Recent Comments

  • Q on 2020 was so bad, we didn’t make a single post
  • annie on 2020 was so bad, we didn’t make a single post
  • annie on One could argue he’d make a poor preacher
  • annie on Monday Fighter!
  • Q on Monday Fighter!

Archives

  • January 2021
  • February 2019
  • November 2018
  • September 2018
  • June 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • August 2016
  • July 2016
  • June 2016
  • March 2016
  • September 2015
  • August 2015
  • May 2015
  • April 2015
  • August 2014
  • July 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • April 2013
  • March 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007

Categories

  • Babes & Alleged Babes
  • Bad Ads
  • Bad Movie Night
  • Blog News
  • Burning Agony
  • CG
  • Chess
  • Computer-fu
  • Corridors & Creatures
  • Eggony
  • Eggs Vs Humans
  • Entertainment
  • Gaming
  • Grilled Cheese
  • History
  • In the News
  • Mascot for President
  • Mathematics
  • Monday Fighter!
  • North Korea
  • Patently Ineffective
  • Random
  • Religion
  • Science/Technology
  • Snake Oil
  • Sports
  • Tournament of Lepers
  • Uncategorized
  • Uncomfortability
  • Weaksauce Losers

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2021 Liquid Egg Product.

Theme: Oceanly by ScriptsTown