Re: [exim-dev] fopen(), umask, and file permissions

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Nigel Metheringham
Datum:  
To: Wakko Warner
CC: exim-dev
Betreff: Re: [exim-dev] fopen(), umask, and file permissions
Wakko Warner wrote:
> Is it possible this could be a slight security concern?
>
> You're creating a file with mode 777 and later chmodding it.
>

Not mode. umask - ie almost entirely the opposite!

I don't like the way the function has a global side effect, (changing
umask) although in this context I guess its OK.

Maybe a reimplementation of fopen based on open and fdopen? For that
matter it seems rather likely that theres a BSD implementation of fopen
with file mode.

    Nigel.