#24604 [Com]: SAFE_MODE design issues
| From: | paulo dot matos at fct dot unl dot pt | Date: | Fri, 15 Oct 2004 08:28:51 +0000 |
| Subject: | #24604 [Com]: SAFE_MODE design issues | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969364540@lists.php.net to get a copy of this message | ||
ID: 24604
Comment by: paulo dot matos at fct dot unl dot pt
Reported By: timo dot hummel at 4fb dot de
Status: Wont fix
Bug Type: Documentation problem
Operating System: SuSE Linux 8.2 Linux 2.4.19
PHP Version: Irrelevant
New Comment:
A workaround/solution to this problem on *nix
Assuming that httpd server runs as apache/apache (uid/gid), and php
script is user/group.
1) php.ini
safe_mode = On
safe_mode_gid = On
2) Create initial data directory, on install phase as:
mkdir /path/to/datadir
chown user.group /path/to/datadir
chmod 2777 /path/to/datadir
3) Create all subdirectories (within php), like:
mkdir(/path/to/datadir/subdir, 02777);
This way all subdirectry will inherit group from initial parent dir and
SAFE_MODE won't complain, since all subdirs
and files will be apache.group.
IMPORTANT NOTE: After any subdirectory creation you shouldn't change
directory permissions, otherwise it will loose
the GID bit and all files/subdirectories created afterwards won't have
group inherited!
Previous Comments:
------------------------------------------------------------------------
[2004-09-25 01:50:23] anton dot php at titov dot net
http://www.titov.net/safemodepatch/ - this patch
should allow you to
write to directories, created by PHP.
------------------------------------------------------------------------
[2004-08-07 17:27:48] vrana@php.net
Behavior of move_uploaded_file() with safe_mode is already described.
Functions affected by safe_mode have already a note about safe_mode.
safe_mode_gid is also already documented: "However, there may be
environments where a strict UID check is not appropriate and a relaxed
GID check is sufficient. This is supported by means of the
safe_mode_gid switch. Setting it to On performs the relaxed GID
checking, setting it to Off (the default) performs UID checking."
I suppose that the behavior of safe_mode is not going to change
according proposal 1.
------------------------------------------------------------------------
[2004-07-16 15:12:14] bramspam at pandora dot be
This is a pretty old bug, so has this been fixed yet? My webhost is
running a pretty darned old PHP version, but I don't see the point in
bugging them to upgrade of this bug isn't fixed yet ..
------------------------------------------------------------------------
[2004-05-31 09:37:18] real763 at uni dot de
uhm thats not great
ftp doenst work , and CGI is not running, too :(
Warning: ftp_connect() [function.ftp-connect]:
php_network_getaddresses: getaddrinfo failed: Name or service not known
in /home/www/htdocs/myhost.com/bla.php on line 382
@develop: plz upgrade SAFE_MODE : - )
------------------------------------------------------------------------
[2004-03-01 02:31:19] timo dot hummel at 4fb dot de
>It makes no sense to let users create
> a dir and not let them write to it.
Well, that's another thing. It's probably about the umask, however,
most providers and/or distribution builders should take care of this,
but aren't.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/24604
--
Edit this bug report at http://bugs.php.net/?id=24604&edit=1