Re: move_uploaded_file, umask, and permissions
| From: | David T-G | Date: | Mon, 01 Dec 2003 09:47:22 +0000 |
| Subject: | Re: move_uploaded_file, umask, and permissions | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171447@lists.php.net to get a copy of this message | ||
Curt, et al --
..and then Curt Zirzow said...
%
% Message-ID: <20031201060339.GI8301@bagend.shire>
Mister Underhill, I presume? :-) I only just noticed this :-)
%
% * Thus wrote David T-G (davidtg-php@justpickone.org):
% >
% > I have set my umask to 117 (and I change it when making a directory) and
% > I use move_uploaded_file to handle submitted files.
..
% > Must I really run chmod() on every move_uploaded_file() I process? Isn't
% > there a better way?
%
% I believe it does, move_uploaded_file() uses the current
% envirionment's umask which seems to be set at an awkward stage.
%
% what is the output of:
% echo
umask;
I just tried it and
print "UMASK IS .".umask.".<br>\n";
gives me
UMASK IS .0117 .
which certainly seems right.
%
% I bet its '11'. I'm not sure how your system is configured but it
I don't get it... Why would you think that? The file as it uploads is
mode 600 == umask 177; the file as dropped into place is 666 == 111.
Nothing like a mask of 11 (which would leave us a mode of 766) has shown
up...
% seems the user apache is running under has that umask set that way
% which, IMO, is a bad thing (tm).
I am inclined to agree.
%
%
% Curt
% --
% If eval() is the answer, you're almost certainly asking the
% wrong question. -- Rasmus Lerdorf, BDFL of PHP
%
% --
% PHP General Mailing List (http://www.php.net/)
% To unsubscribe, visit: http://www.php.net/unsub.php
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!