Re: [SMARTY] Re: is this a bug?
| From: | messju mohr | Date: | Thu, 27 Feb 2003 17:56:48 +0000 |
| Subject: | Re: [SMARTY] Re: is this a bug? | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8271@lists.php.net to get a copy of this message | ||
On Fri, Feb 28, 2003 at 01:19:01AM +0800, Jun wrote:
> "Messju Mohr" <messju@lammfellpuschen.de> wrote in message
> news:20030227171055.GF19597@pharao.lammfellpuschen.de...
> > On Fri, Feb 28, 2003 at 12:43:23AM +0800, Jun wrote:
> > > I even asked the admin to make cache and templates_c world writable,
> > > executable, readable...including its subfolders.. but stil.... some
> > > directories are created with permissions with limited access.
> >
> > there is only one single location in Smarty.class.php where directories
> > are created. this is in function _create_dir_structure()
> >
> > mkdir is called ther this waye:
> > mkdir($_new_dir, $this->_dir_perms)
> >
> > looking at the documentation of mkdir (
> > http://php.net/mkdir )
> >
> > "Attempts to create the directory specified by pathname.
> >
> > Note that you probably want to specify the mode as an octal number,
> > which means it should have a leading zero. The mode is also modified
> > by the current umask, which you can change using umask()."
> >
> > so: these 2 values are involved in the permissions of the created
> directory
> > the permissions are "$this->_dir_perms && umask()". so at least one
> > of the
> > two is screwed in your setup. smarty is not.
>
>
> SO, do I have to modify Smarty.class.php
> function _create_dir_structure()
> instead of
> mkdir($_new_dir, $this->_dir_perms)
> I should change the line to
> mkdir($_new_dir, $this->_dir_perms && umask())
no. no. the php-docs say, that this is done implicitely. php does not
change the permissions to the value in the 2nd parameter, but combines
it with the current umask. only the bit, that are set in both values,
are set.
this implies to me, that your $this->_dir_perms or your umask() isn't
correct.
what is printet to the page, if you do
printf("%04o %04o %04o\n", $smarty->_dir_perms, umask(), $smarty->_dir_perms &
~umask());
it should print something like:
0771 0022 0751
the first number are the permissions that smarty want to give to the
dir. the second has the bits set, that are cleared out the
permissonmask before applying it to the dir. the third is the
resulting permission-mask, that is given to die dir.
the third should be at least 0700 or greater!
HTH
messju
> I can't change anything on my scripts because I don't call mkdir function..
> its Smarty whose calling the function... right?
>
> ---jun
>
>
>
> > have fun
> > messju
> >
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
voll konfigurierbar: nicht vorinstalliert.
Peter Berlich