[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: checking to see if a file include scheme
From: |
Han-Wen Nienhuys |
Subject: |
Re: checking to see if a file include scheme |
Date: |
Tue, 23 Jan 2007 23:42:41 +0100 |
User-agent: |
Thunderbird 1.5.0.9 (X11/20061219) |
Graham Percival escreveu:
> As a security measure, I'd like to have a script that checks if a
> lilypond file contains any scheme. Is there any better way than
> searchign for "#(define" ?
>
> I'm not worried about a few false positives (if any non-scheme .ly file
> just happened to have "#(define" in the text somewhere), but could a
> malicious person add whitespace and have "#( define" ? If so, is there
> a way to search for such a whitespace-including string in python?
I'd search for the regex "#[ \t\n]*("
(define )
is not what you should worry about, but rather the other calls, such as
#(system "rm -rf /")
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen
LilyPond Software Design
-- Code for Music Notation
http://www.lilypond-design.com