From: Lawrence D'Oliveiro on
In message <mailman.2046.1277445301.32709.python-list(a)python.org>, Cameron
Simpson wrote:

> On 25Jun2010 15:38, Lawrence D'Oliveiro <ldo(a)geek-central.gen.new_zealand>
> wrote:
>
> | In message <2010062422432660794-angrybaldguy(a)gmailcom>, Owen Jacobson
> | wrote:
>
> | > Why would I write this when SQLAlchemy, even without using its ORM
> | > features, can do it for me?
> |
> | SQLAlchemy doesn't seem very flexible. Looking at the code examples
> | <http://www.sqlalchemy.org/docs/examples.html>, they're very procedural:
> | build object, then do a string of separate method calls to add data to
> | it. I prefer the functional approach, as in my table-update example.
>
> He said "without using its ORM".

I noticed that. So were those examples I referenced above “using its ORM”?
Can you offer better examples “without using its ORM”?
From: Lawrence D'Oliveiro on
In message <slrni297ec.1m5.grahn+nntp(a)frailea.sa.invalid>, Jorgen Grahn
wrote:

> I thought it was well-known that the solution is *not* to try to
> sanitize the input -- it's to switch to an interface which doesn't
> involve generating an intermediate executable. In the Python example,
> that would be something like os.popen2(['zcat', '-f', '--', untrusted]).

That's what I mean. Why do people consider input sanitization so hard?
From: Owen Jacobson on
On 2010-06-25 20:49:09 -0400, Lawrence D'Oliveiro said:

> In message <slrni297ec.1m5.grahn+nntp(a)frailea.sa.invalid>, Jorgen Grahn
> wrote:
>
>> I thought it was well-known that the solution is *not* to try to
>> sanitize the input -- it's to switch to an interface which doesn't
>> involve generating an intermediate executable. In the Python example,
>> that would be something like os.popen2(['zcat', '-f', '--', untrusted]).
>
> That's what I mean. Why do people consider input sanitization so hard?

It's not hard. It's just begging for a visit from the fuckup fairy.

-o

From: Robert Kern on
On 2010-06-25 19:47 , Lawrence D'Oliveiro wrote:
> In message<mailman.2046.1277445301.32709.python-list(a)python.org>, Cameron
> Simpson wrote:
>
>> On 25Jun2010 15:38, Lawrence D'Oliveiro<ldo(a)geek-central.gen.new_zealand>
>> wrote:
>>
>> | In message<2010062422432660794-angrybaldguy(a)gmailcom>, Owen Jacobson
>> | wrote:
>>
>> |> Why would I write this when SQLAlchemy, even without using its ORM
>> |> features, can do it for me?
>> |
>> | SQLAlchemy doesn't seem very flexible. Looking at the code examples
>> |<http://www.sqlalchemy.org/docs/examples.html>, they're very procedural:
>> | build object, then do a string of separate method calls to add data to
>> | it. I prefer the functional approach, as in my table-update example.
>>
>> He said "without using its ORM".
>
> I noticed that. So were those examples I referenced above “using its ORM”?
> Can you offer better examples “without using its ORM”?

http://www.sqlalchemy.org/docs/sqlexpression.html

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

From: Tim Chase on
On 06/25/2010 07:49 PM, Lawrence D'Oliveiro wrote:
>> In the Python example, that would be something like
>> os.popen2(['zcat', '-f', '--', untrusted]).
>
> That's what I mean. Why do people consider input sanitization
> so hard?

It's hard because it requires thinking. Sadly, many of the
people I know who call themselves programmers couldn't code their
way out of a paper bag, let alone think logically about the
security implications of their code.[1]

-tkc


[1] much of which ends up being cargo-cult programming,
cut-n-paste'd from Google search-results.