Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81209

Re: Using Python for date calculations

From alister <alister.nospam.ware@ntlworld.com>
Subject Re: Using Python for date calculations
Newsgroups comp.lang.python
References <k7tt6aheccqv06enkume0vs0v6kvvhns45@4ax.com> <mailman.16088.1416559225.18130.python-list@python.org> <e44u6a121qs79midbsfeotejdde9vbs2n9@4ax.com> <0yEbw.852077$KL.733426@fx19.am4> <mailman.16100.1416578070.18130.python-list@python.org>
Message-ID <7nIbw.947087$ac7.785085@fx15.am4> (permalink)
Organization virginmedia.com
Date 2014-11-21 14:54 +0000

Show all headers | View raw


On Fri, 21 Nov 2014 08:54:23 -0500, random832 wrote:

> On Fri, Nov 21, 2014, at 05:33, alister wrote:
>> the problem with input is code-injection which is very similar to sql
>> injection (httpd://xkcd.com/327).
>> 
>> the data entered by the user is processed as if it was python code,
>> this means the user could enter a command (or sequence of commands)
>> that cause serious problems to you computer including but not limited
>> to:-
> 
> Except standard input for interactive programs is rarely across a
> privilege boundary. The user can accomplish any of these far more easily
> by entering a command into their shell. (Well, more easily depending on
> which is better able to use the API for their central heating, but the
> others certainly).
> 
> There are good reasons to avoid it (user is likely to be surprised by
> weird error messages, causing a crash due to a typo), but this kind of
> paranoia is the same as has people in some circles refusing to use
> strlcpy or fgets because they can cause silent truncation.

If the program in question is purely for personal use then indeed it is 
not important, as you say I can just as easily stuff my computer without 
needing to play silly b******s with a python script.

It is if the program is ever going to be used by others (or possibly 
worse running on something like a web server exposed to the public 
internet) that needs paranoia.
my own personal opinion is that it is best to get into good habits even 
with personal use "Quick & Dirty" scripts, you never know how they could 
evolve



-- 
	"What terrible way to die."
	"There are no good ways."
		-- Sulu and Kirk, "That Which Survives", stardate unknown

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 10:35 +0200
  Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 19:40 +1100
    Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 12:15 +0200
      Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 21:18 +1100
      Re: Using Python for date calculations alister <alister.nospam.ware@ntlworld.com> - 2014-11-21 10:33 +0000
        Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 21:47 +1100
        Re: Using Python for date calculations random832@fastmail.us - 2014-11-21 08:54 -0500
          Re: Using Python for date calculations alister <alister.nospam.ware@ntlworld.com> - 2014-11-21 14:54 +0000
        Re: Using Python for date calculations random832@fastmail.us - 2014-11-21 08:58 -0500
          Re: Using Python for date calculations Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-22 01:55 +1100
            Re: Using Python for date calculations Ned Batchelder <ned@nedbatchelder.com> - 2014-11-21 10:25 -0500
        Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-22 01:08 +1100
      Re: Using Python for date calculations Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-21 14:50 -0500
        Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-22 07:07 +0200
          Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-22 16:13 +1100
  Re: Using Python for date calculations Gary Herron <gary.herron@islandtraining.com> - 2014-11-21 00:50 -0800
  Re: Using Python for date calculations Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-21 10:20 +0000
    Re: Using Python for date calculations alister <alister.nospam.ware@ntlworld.com> - 2014-11-21 10:38 +0000
    Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 17:50 +0200
      Re: Using Python for date calculations Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-21 16:01 +0000
  Re: Using Python for date calculations Chris Angelico <rosuav@gmail.com> - 2014-11-21 21:27 +1100
  Re: Using Python for date calculations duncan smith <buzzard@invalid.invalid> - 2014-11-21 17:03 +0000
    Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-21 21:48 +0200
      Re: Using Python for date calculations Dennis Lee Bieber <bieber.genealogy@earthlink.net> - 2014-11-21 15:32 -0500
  Re: Using Python for date calculations Dennis Lee Bieber <bieber.genealogy@earthlink.net> - 2014-11-21 14:35 -0500
    Re: Using Python for date calculations Paul Blair <p.blair@internode.on.net> - 2014-11-22 06:51 +1100
      Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-22 07:31 +0200
    Re: Using Python for date calculations Denis Beauregard <denis.b-at-francogene.com@fr.invalid> - 2014-11-21 15:07 -0500
      Re: Using Python for date calculations Steve Hayes <hayesstw@telkomsa.net> - 2014-11-22 07:34 +0200

csiph-web