Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.05; 'think,': 0.07; 'works.': 0.07; 'python': 0.09; 'charset:iso-8859-7': 0.15; 'sat,': 0.15; 'backward': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'trying': 0.21; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'run': 0.28; 'ball': 0.29; 'skip:/ 40': 0.29; "skip:' 10": 0.30; 'that.': 0.30; 'figure': 0.30; 'located': 0.31; 'file': 0.32; "skip:' 20": 0.32; 'to:addr:python-list': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'really': 0.36; 'anything': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'page': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'step': 0.39; 'your': 0.60; 'levels': 0.66; '2013': 0.84; 'addon': 0.84; 'joel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=ctXdNVauMJv8+MudshUqi2cjQ0pC3j2Inecq6lgV8fs=; b=J6SzxbtixCDrMjNu6iiy+qEozLJ+zgrtyPwGlCUTf6mZykHNNl1znkAqRaASCbIFIf Q3iCWS6ODjzYa2Lw0KqN79JhtNFgAP5kvbIUXryNWEJsMVnfnuJCvY8O4X5PUdNdad1H yD4RiG29v4TWKi44yP7KFfvM1xBqiXM7XfGVdu8KGzDNv422ZaIu3hToU33pJCeRyx+N msOT6O4iP6IexAGRQE37S8/W+DVX6aAUy/O5g6ixdZSULyQAyDlkf6h6vPZ9MkhjeGSb GK5G7DmjHbDI1RL5pBarC5GPmOJr7OK3lbUf9LwCGNmb/nk4roKhvf5sZSy5tOrR35OW KGHA== MIME-Version: 1.0 X-Received: by 10.220.238.139 with SMTP id ks11mr11102383vcb.49.1358544845264; Fri, 18 Jan 2013 13:34:05 -0800 (PST) In-Reply-To: <2bf766db-ffcd-4a7f-8e08-6e3400618e78@googlegroups.com> References: <339d9d6d-b000-4cf3-8534-375e0c44b2ca@googlegroups.com> <10ebf68d-12f9-46d6-be50-6c314500302d@googlegroups.com> <2bf766db-ffcd-4a7f-8e08-6e3400618e78@googlegroups.com> Date: Sat, 19 Jan 2013 08:34:05 +1100 Subject: Re: Forcing Python to detect DocumentRoot From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358544847 news.xs4all.nl 6871 [2001:888:2000:d::a6]:50747 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37031 On Sat, Jan 19, 2013 at 5:58 AM, Ferrous Cranus wro= te: > =D4=E7 =D0=E1=F1=E1=F3=EA=E5=F5=DE, 18 =C9=E1=ED=EF=F5=E1=F1=DF=EF=F5 201= 3 3:28:10 =EC.=EC. UTC+2, =EF =F7=F1=DE=F3=F4=E7=F2 Joel Goldstick =DD=E3= =F1=E1=F8=E5: > >> DocumentRoot =3D os.environ['HOME'] + 'public_html' > > Yes, iam using this and it works. > One last thing: > > my python script file is located at /home/nikos/public_html/addon_domain/= cgi-bin/ > > How python is able to run the following statement? > > f =3D open( '/home/nikos/public_html/' + page ) > > which is clearly levels up of addon domain's DocumentRoot? Time to take a step backward and figure out what you're really trying to accomplish. I think, after gazing idly into my crystal ball for a while, that you actually want to chroot your script - instead of seeing "/home/nikos/public_html/" it would see just "/", and then it can't access anything outside of that. ChrisA