Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'context': 0.04; 'example)': 0.07; 'python': 0.08; 'context.': 0.09; 'directories?': 0.09; 'failing': 0.09; 'from:addr:timgolden.me.uk': 0.09; 'from:name:tim golden': 0.09; 'message-id:@timgolden.me.uk': 0.09; 'subprocess': 0.09; 'exception': 0.12; 'crack': 0.16; 'invoking': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.22; 'default,': 0.23; 'creating': 0.25; 'parent': 0.30; 'tjg': 0.30; 'yes.': 0.30; '(the': 0.30; "isn't": 0.33; 'header:User-Agent:1': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'certain': 0.34; 'calling': 0.34; 'running': 0.35; 'something': 0.35; 'unless': 0.35; 'david': 0.36; 'but': 0.37; 'received:192': 0.37; 'think': 0.37; 'doing': 0.38; 'received:192.168.0': 0.38; 'processing': 0.39; 'should': 0.39; 'called': 0.40; 'to:addr:python.org': 0.40; 'received:192.168': 0.40; 'you.': 0.63; 'from:addr:mail': 0.64; 'here': 0.65; 'deliberate': 0.84; 'directories,': 0.84; 'received:192.168.0.5': 0.84; 'subject:write': 0.84; 'elevated': 0.91; 'subject:made': 0.93; 'absolutely': 0.98 Date: Sun, 01 Jan 2012 15:05:58 +0000 From: Tim Golden User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Can't write to a directory made w/ os.makedirs References: <50693cc2-93c9-481d-9fb1-42312e69b2d9@c42g2000prb.googlegroups.com> <91830ffb-00d9-4fd1-b771-ad59374334ec@n22g2000prh.googlegroups.com> In-Reply-To: <91830ffb-00d9-4fd1-b771-ad59374334ec@n22g2000prh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325430363 news.xs4all.nl 6869 [2001:888:2000:d::a6]:36188 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18295 On 01/01/2012 12:05, David Goldsmith wrote: >> ie can the Python process creating the directories, > > Yes. > >> and a subprocess called from it create a simple file? > > No. > >> Depending on where you are in the filesystem, it may indeed >> be necessary to be running as administrator. But don't try >> to crack every security nut with an elevated sledgehammer. > > If you mean running as admin., those were my sentiments exactly. So, > there isn't something specific I should be doing to assure that my > subproceses can write to directories? In the general case, no. By default, a subprocess will have the same security context as its parent. The exception is where the parent (the Python processing invoking subprocess.call in this example) is already impersonating a different user; in that case, the subprocess will inherit its grandparent's context. But unless you're doing something very deliberate here then I doubt if that's biting you. Can I ask: are you absolutely certain that the processes you're calling are doing what you think they are and failing where you think they're failing? TJG