Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3859 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43042 invoked from network); 11 Aug 2003 18:20:44 -0000 Received: from unknown (HELO pigeon.alphaweb.net) (64.142.6.229) by pb1.pair.com with SMTP; 11 Aug 2003 18:20:44 -0000 Received: from localhost ([127.0.0.1] helo=alphaweb.net) by pigeon.alphaweb.net with smtp (Exim 4.10) id 19mHXY-000615-00; Mon, 11 Aug 2003 11:37:08 -0700 Received: from (SquirrelMail authenticated user sarag) by with HTTP; Mon, 11 Aug 2003 11:37:08 -0700 (PDT) Message-ID: <..1060627028.squirrel@> Date: Mon, 11 Aug 2003 11:37:08 -0700 (PDT) To: In-Reply-To: <20030812021011DRqTvP@at.wakwak.com> References: <20030810003052.95044.qmail@pb1.pair.com> <20030812021011DRqTvP@at.wakwak.com> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: Reply-To: pollita@php.net X-Mailer: SquirrelMail (version 1.2.7) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [Review] Route stat() family of calls via wrapper ops. From: pollita@php.net ("Sara Golemon") > wrote: > >> The ugliest part of this patch is that it requires special treatment >> for the plainfiles wrapper in order to deal with symlink stat calls. >> An alternative (and it wouldn't take much to convince me to go the >> other way) would be to add a parameter to the url_stat() method to >> indicate if the stat is a symlink_stat. > > If we implement url_stat() in such way, perhaps we can live without > access_check() method. > Yeah, I got to thinking that later on.... Perhaps the cleanest method would be to pass on the filestat_type directly to the url_stat method. plainfiles can then do VCWD_ACCESS, VCWD_STAT, or VCWD_LSTAT as appropriate and other wrappers can do their thing. (additionally: http, since it allows redirection, would be able to emulate the symlink layer by returning information on the initial hit, rather than following 302 redirects) The php_stat method in filestat.c can then focus on simply managing the statecache and forming the statbuf into returnable zvals. > But the point is, not all wrappers can accept > *ix-like access control scheme.. > Nor can they return full stat detail. i.e.: What's the filesize of php://stdin ? Who "owns" http://example.com/foo.html ? Last I spoke to Wez on the subject he indicated that we should just attempt to return as much information as we can and default on the rest. http:// wrapper: is_writable() would always return false. is_readable() would return true *IF* a HEAD request returned 2xx or 3xx is_executable() would always return false. file_exists() would return true if a HEAD request returned 2xx, 3xx, or 4xx (not including 404) sb values such as mtime, size, etc... would be parsable from the http-response headers, while ctime, atime, inode, uid, gid would be unknown and default to 0 (or maybe -1) ftp:// wrapper: is_writeable() would return true if APPE returned 2xx is_readable() would return true if RETR returned 2xx is_executable() would always return false file_exists() would return true if SIZE returned 2xx sb_size would be fetchable from SIZE , however all other values are not reliable on all platforms and would have to return 0. -Sara