Changeset 36:b0f18ac6f8bd

Show
Ignore:
Timestamp:
05/18/06 09:31:01 (2 years ago)
Author:
Allan Saddi <allan@saddi.com>
branch:
default
convert_revision:
svn:46762da8-4eb7-0310-94e9-d918b60927c8/flup/trunk@1968
Message:

Added umask keyword parameter to fcgi and fcgi_fork,
for use when binding to a UNIX socket.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r35 r36  
     12006-05-18  Allan Saddi  <asaddi@kalahari.flup.org> 
     2 
     3        * Added umask keyword parameter to fcgi and fcgi_fork, 
     4          for use when binding to a UNIX socket. 
     5 
    162006-05-03  Allan Saddi  <asaddi@kalahari.flup.org> 
    27 
  • flup/server/fcgi.py

    r32 r36  
    6464    def __init__(self, application, environ=None, 
    6565                 multithreaded=True, multiprocess=False, 
    66                  bindAddress=None, multiplexed=False, 
     66                 bindAddress=None, umask=None, multiplexed=False, 
    6767                 debug=True, **kw): 
    6868        """ 
     
    8585                                multiprocess=multiprocess, 
    8686                                bindAddress=bindAddress, 
     87                                umask=umask, 
    8788                                multiplexed=multiplexed, 
    8889                                debug=debug) 
  • flup/server/fcgi_base.py

    r32 r36  
    900900    def __init__(self, application, environ=None, 
    901901                 multithreaded=True, multiprocess=False, 
    902                  bindAddress=None, multiplexed=False, 
     902                 bindAddress=None, umask=None, multiplexed=False, 
    903903                 debug=True): 
    904904        """ 
     
    912912        is the port number. 
    913913 
     914        If binding to a UNIX socket, umask may be set to specify what 
     915        the umask is to be changed to before the socket is created in the 
     916        filesystem. After the socket is created, the previous umask is 
     917        restored. 
     918         
    914919        Set multiplexed to True if you want to handle multiple requests 
    915920        per connection. Some FastCGI backends (namely mod_fastcgi) don't 
     
    929934 
    930935        self._bindAddress = bindAddress 
    931  
     936        self._umask = umask 
     937         
    932938        # Used to force single-threadedness 
    933939        self._appLock = thread.allocate_lock() 
     
    988994        else: 
    989995            # Run as a server 
     996            oldUmask = None 
    990997            if type(self._bindAddress) is str: 
    991998                # Unix socket 
     
    9951002                except OSError: 
    9961003                    pass 
     1004                if self._umask is not None: 
     1005                    oldUmask = os.umask(self._umask) 
    9971006            else: 
    9981007                # INET socket 
     
    10051014            sock.listen(socket.SOMAXCONN) 
    10061015 
     1016            if oldUmask is not None: 
     1017                os.umask(oldUmask) 
     1018                 
    10071019        return sock 
    10081020 
  • flup/server/fcgi_fork.py

    r32 r36  
    6464    """ 
    6565    def __init__(self, application, environ=None, 
    66                  bindAddress=None, multiplexed=False, 
     66                 bindAddress=None, umask=None, multiplexed=False, 
    6767                 debug=True, **kw): 
    6868        """ 
     
    8585                                multiprocess=True, 
    8686                                bindAddress=bindAddress, 
     87                                umask=umask, 
    8788                                multiplexed=multiplexed, 
    8889                                debug=debug)