httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: [?PATCH?] using getpwnam_r in mod_userdir
Date Fri, 10 Nov 2000 22:48:16 GMT
Sascha Schumann <sascha@schumann.cx> writes:

>     Our "user" code like mod_userdir.c should just assume that
>     getpwnam_r exists. If it does not exist, we can provide a
>     fallback which serializes access to the OS-function.
>     Otherwise, we start duplicating work-arounds and checks all
>     over the place.
> 
>     I'm attaching such a fallback for getpwnam_r. There are two
>     issues with this:
> 
>     -   ACQUIRE_LOCK/RELEASE_LOCK should be defined to mutex-like
>         functions, if we are compiling thread-safe (otherwise,
>         they are nops).
>     -   The getpwnam_r function should be prefixed properly to
>         avoid conflicts with system functions which have the same
>         name, but another interface.

Another issue (perhaps not affecting more than one system): it
assumes that getpwnam() isn't thread-safe.  If getpwnam() is
thread-safe, we don't need the lock and we don't need to copy.

How many of these reentrant function issues have come up with PHP?

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message