Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40095 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40375 invoked from network); 26 Aug 2008 16:25:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2008 16:25:40 -0000 Authentication-Results: pb1.pair.com header.from=diegows@xtech.com.ar; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=diegows@xtech.com.ar; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain xtech.com.ar from 216.75.63.130 cause and error) X-PHP-List-Original-Sender: diegows@xtech.com.ar X-Host-Fingerprint: 216.75.63.130 mail.xtech.com.ar Linux 2.6 Received: from [216.75.63.130] ([216.75.63.130:44887] helo=mail.xtech.com.ar) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/00-03121-E7E24B84 for ; Tue, 26 Aug 2008 12:25:39 -0400 Received: by mail.xtech.com.ar (Postfix, from userid 19418) id 1A04B5A800D; Tue, 26 Aug 2008 13:42:15 -0300 (ART) Received: from webmail.xtech.com.ar (localhost.localdomain [127.0.0.1]) by mail.xtech.com.ar (Postfix) with ESMTP id C1DE25A800C; Tue, 26 Aug 2008 13:42:14 -0300 (ART) Received: from 29-22-190-190.cab.prima.net.ar ([190.190.22.29]) (SquirrelMail authenticated user diegows@xtech.com.ar) by webmail.xtech.com.ar with HTTP; Tue, 26 Aug 2008 13:42:14 -0300 (ART) Message-ID: <37211.190.190.22.29.1219768934.squirrel@webmail.xtech.com.ar> In-Reply-To: <48B40F50.20008@sci.fi> References: <20080821005220.GA23091@motherbox.xtech.com.ar> <48ACCB1E.8030607@sci.fi> <54207.190.190.22.29.1219756536.squirrel@webmail.xtech.com.ar> <48B40F50.20008@sci.fi> Date: Tue, 26 Aug 2008 13:42:14 -0300 (ART) To: jani.taskinen@iki.fi Cc: "Diego Woitasen" , internals@lists.php.net User-Agent: SquirrelMail/1.4.7 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.0.2 Subject: Re: [PHP-DEV] [PATCH] add imap_myrights From: diegows@xtech.com.ar ("Diego Woitasen") On Tue, August 26, 2008 11:12 am, Jani Taskinen wrote: > Diego Woitasen wrote: >> On Wed, August 20, 2008 10:55 pm, Jani Taskinen wrote: >>> Diego Woitasen kirjoitti: >>>> Hi, >>>> I attach the patch that adds imap_myrights function to IMAP module. >>>> MYRIGHTS is a standard IMAP command defined in RFC 2086. >>>> >>>> diff -u -r php-5.2.6/ext/imap/php_imap.c >>>> php-myrights/ext/imap/php_imap.c >>>> --- php-5.2.6/ext/imap/php_imap.c Thu Apr 17 13:04:49 2008 >>>> +++ php-myrights/ext/imap/php_imap.c Tue Jun 3 18:06:37 2008 >>>> @@ -154,6 +154,7 @@ >>>> PHP_FE(imap_set_quota, NULL) >>>> PHP_FE(imap_setacl, NULL) >>>> PHP_FE(imap_getacl, NULL) >>>> + PHP_FE(imap_myrights, NULL) >>>> #endif >>>> >>>> PHP_FE(imap_mail, NULL) >>>> @@ -413,6 +414,20 @@ >>>> } >>>> /* }}} */ >>>> >>>> +/* {{{ mail_myrights >>>> + * >>>> + * Mail MYRIGHTS callback >>>> + * Called via the mail_parameter function in >>>> c-client:src/c-client/mail.c >>>> + */ >>>> +void mail_myrights(MAILSTREAM *stream, char *mailbox, char *rights) >>>> +{ >>>> + TSRMLS_FETCH(); >>>> + >>>> + ZVAL_STRING(IMAPG(imap_acl_list), rights, 1) >>>> + >>>> +} >>>> +/* }}} */ >>>> + >>>> #endif >>> Does this really work? You're blindly overwriting the acl global, >>> AFAICT..? >>> Or is that intentional? >> >> Yes, it works. I use the imap_getacl() function as example to write >> imap_myrights(). What's the problem with overwriting acl global? > > So you don't use imap_setacl/imap_getacl ?? Or care if someone else > does? I'm not sure how this really works, but it doesn't sound quite > right.. > > --Jani > I looked at the code again. imap_acl_list contains the last value returned by imap_getacl() (and imap_myrights() with the patch). I don't undertand why writing that variable is a problem. GETACL and MYRIGHTS have different meanings, the first gets all ACLs of a folder and the second just only the ACLs of the current user. If the users doesn't have permissions or isn't the owner, GETACL fails and MYRIGHTS no. -- Diego Woitasen XTECH - Soluciones Linux para empresas (54) 011 5219-0678