Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DEDA1632F5F for ; Sat, 5 Sep 2009 14:53:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 46005-02 for ; Sat, 5 Sep 2009 17:53:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mail.postgresql.org (Postfix) with ESMTP id C77616328DD for ; Sat, 5 Sep 2009 14:53:21 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id 22so404773fge.1 for ; Sat, 05 Sep 2009 10:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=bDn3li9lC5UvYitKXdgs6TDMUZf3R7u8PUZUyK//itQ=; b=vucvCa0zIYX5JstEZz3jLgkDiGD5nSOacGVzBmYF9T4sEv7zG4d2YRnSspRSQ+i2sV phOrRIl0uQp7Vy9d5Q9wKhBuJeo4MT9CUHvsAdT40etgxpa5Go1VSkAokRcXImqM9nxV 8R4EZCtAjIl5F7JHo1+ApiukjsEeNWSb/+QQU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=azmklEhBJyGySL3xtlwluZ5qDMFHrcdJkvzNmFRqnbcPNqhH993SIi/5hmKPLfzAsl QiGGzEVwYV9LxN3upuQk3RrRdWWOKZAnkYdgzO8HCcGVvMhmCY+cxE1fUSUssA5wyaIg VDLjtMJsJPTeJrLlzJqaphRX6NXJgDBfzE+Dc= Received: by 10.86.231.13 with SMTP id d13mr6238992fgh.41.1252173199699; Sat, 05 Sep 2009 10:53:19 -0700 (PDT) Received: from ?192.168.0.4? (ALyon-158-1-88-84.w90-29.abo.wanadoo.fr [90.29.111.84]) by mx.google.com with ESMTPS id 4sm5341648fge.24.2009.09.05.10.53.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Sep 2009 10:53:19 -0700 (PDT) Message-ID: <4AA2A589.9020405@gmail.com> Date: Sat, 05 Sep 2009 19:53:13 +0200 From: Piaff33z User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org CC: Greg Sabino Mullane Subject: Re: problem on test perlu trigger function. References: <6f8c66fd5a3c12667eff14d54a398d70@biglumber.com> In-Reply-To: <6f8c66fd5a3c12667eff14d54a398d70@biglumber.com> Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.141 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.457 X-Spam-Level: X-Archive-Number: 200909/3 X-Sequence-Number: 6882 :-[   I am stupid, it is obvious !

Really you are right :-D , script is thrown with the rights of account postgres and it does not have the rights to browse this directory ...
Your proposal of the "mkdir -p" seems to me the better solution !

Still thank you for this analysis !

However, i have an other problem and I am going to open new thread. And that there seems to me a little more crooked...

Vic    :-)

Greg Sabino Mullane a écrit :
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


  
if (! -d  "$PATHBASE/$_TD->{new}{categorie}") {
         `sudo -u http mkdir "$PATHBASE/$_TD->{new}{categorie}"`;
      }
    

  
Sudo function is performed in spite of the presence of directory ! It as
if  "-d" serve has nothing...

Anybody knows why?
    

Because the directory is created and owned by the http user, but is not
visible to the process that runs this function (postgres). One solution
would be to skip the test and call mkdir -p. Another would be to set
the permissions so that the postgres user can see the directories
inside of $PATHBASE.

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200909050729
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkqiS88ACgkQvJuQZxSWSshetgCbB3ao2kGembYXswSu7fQ77NFH
4lEAoMfBRsbbNMg4g8wSgIJ6iE+mhFHC
=esTM
-----END PGP SIGNATURE-----