Re: safe_mode.c: php_checkuid() mode

From: Date: Mon, 09 Jul 2001 22:49:03 +0000
Subject: Re: safe_mode.c: php_checkuid() mode
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59465@lists.php.net to get a copy of this message
Nix those mumblings about file existence ... but what about
bits vs not-bits for the mode?
-James

On Mon, 9 Jul 2001, James E. Flemer wrote:

> Rasmus, can you clarify the 'mode' parameter in
> php_checkuid()? In safe_mode.h there are 5 defined values,
> the 5th is: (which is used in fopen_wrappers.c ...)
> 	#define CHECKUID_CHECK_MODE_PARAM 4
>
> However, in safe_mode.c CHECKUID_CHECK_MODE_PARAM is not
> used, and furthermore if 'fopen_mode' is not null, 'mode'
> is overwritten anyway (depending if fopen_mode ~= 'r')
> [line 56ish].
>
> It seems that it exists there for possible expansion ... is
> this correct?
>
> So my question is ...
> Can/should the 'mode' and the CHECKUID_* defines be changed
> to bit flags (like php_fopen_wrapper() mode flags)?
>
> My motivation for this is to be able to check *just* for a
> files existence, not checking UID/GID.
>
> Possibly a better way to do this would be to split
> php_checkuid() into php_checkexists() and php_checkuid(),
> where the former would be called by the latter (as to
> not break anything)...
> This might be more intuitive, and then I won't have to
> duplcate the code to check for the file (as small as it
> is).
>
> Any comments?
> -James
>
>
>



Thread (3 messages)

« previous php.dev (#59465) next »