httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: cvs commit: apache-2.0/src/main http_log.c
Date Mon, 12 Jun 2000 17:36:23 GMT
> From:
> Date: 12 Jun 2000 16:00:34 -0000
> rbb         00/06/12 09:00:33
>   Modified:    src/lib/apr/file_io/unix open.c
>                src/lib/apr/include apr_file_io.h
>                src/main http_log.c
>   Log:
>   Add a new function ap_set_default_fperms.  This allows people to set the
>   umask to be used when creating files.  This should change the permissions
>   of files created using APR_DEFAULT_OS.  Also removed a warning introduced
>   with the sys/stat.h changes.

I think ap_set_default_fperms() is a misleading function name.  It
doesn't directly set file permissions.  It actually does just the
opposite, depending on how you look at it.  If I call
would seem that a file I then create with APR_OS_DEFAULT should be
rw-rw----, but instead I am assured that those flags are *not* on
because ap_set_default_fperms() passed 0660 to umask().

If I look at the function name and I read your documentation, I don't
see any mention of the umask behavior.  Also, unless on non-Unix you
want to simulate umask behavior in setting the permissions of other
files created via APR, I don't think setting-the-umask belongs in APR

I'm also a little disturbed about setting the process umask, as it
will affect everything done by the process, not just the APR file I/O

What do we really want to accomplish?  It seems that with the
http_log.c you committed, we want to ensure that log files are only
writable by the owner.  Maybe what we instead need is a flag like
APR_PERM_ABSOLUTE which when passed to ap_open() along with
permissions says that APR must do whatever it takes (including
temporarily subverting the process's umask on Unix) to ensure that
they are exactly as specified and not subject to any twiddling
according to any environmental settings (e.g., umask).

Jeff Trawick | | PGP public key at web site:
          Born in Roswell... married an alien...

View raw message