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

Pàgina inicial
Delete this message
Reply to this message
Autor: Marc Haber
Data:  
A: exim-dev
Assumpte: Re: [exim-dev] fopen(), umask, and file permissions
On Wed, Feb 22, 2006 at 02:51:23PM +0000, Philip Hazel wrote:
> + FILE *
> + modefopen(uschar *filename, char *options, mode_t mode)
> + {
> + FILE *f;
> + umask(0777);
> + f = Ufopen(filename, options);
> + umask(0);
> + if (f != NULL) (void)fchmod(fileno(f), mode);
> + return f;
> + }


better do something along the line of

mode_t saved;
saved = umask(0777);
f = Ufopen(filename, options);
umask(saved);

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835