[Typo3-dev] calculation and display of filepermissions in filelist

Peter Niederlag niederlag at ikd01.de
Sun Jun 20 18:13:36 CEST 2004


Hi,

WK schrieb am 20.06.2004 um 17:05 Uhr CEST

> 
>  *hiya!*
> 
>  On Fri, 18 Jun 2004, Kasper Skårhøj wrote the following:
> > Yes, could be interesting! All my files in the Filelist module also
> > have"RW" but can be edited though. I didn't find it that important
> > to fix so I didn't go into it. if someone could fix this bug to be
> > cross-platform/safe_mode compliant that would be a great help to
> > avoid confusion for users.
> 
>  Hmm, after inspecting this a little bit I came to the conclusion that
>  it's not possible to make this work on a broad range of setups.
>  (with the current code!)
> 
>  Unless you use suExec you'll always get root's values with getmyuid
>  instead of the uid of the apache user specified in the apache conf
>  file!

getmyuid() afaik returns the owner of the script that is currently
running. If you get root's value the script probably is owned by root.
;)

>  I wonder why you don't use "is_writable" and "is_readable"?
>  (they work reliable, don't they?) And it works for directories too.
> 
> ----------
> function getTotalFileInfo($wholePath) {
>  // -----------8<------------- snip -----------------------
>     $info['writeable'] = is_writable($wholePath);
>     $info['readable'] = is_readable($wholePath);
> }
> ----------

That is what I wanted to do some testing on. It won't be
correct with safe_mode, which probably would need some "extra checks".

However there seems to be no easy way to get the uid of the proces that
PHP is running with, at least I haven't found anything.

Cheers,
Peter
--
Peter Niederlag
*** aktuell: Seminare zu Typo3 ***
http://typo3.naw.de





More information about the TYPO3-dev mailing list