Bug#280282: exim4-daemon-heavy: files in /var/spool/exim4/scan are
mode 666
Marc Haber
mh+debian-packages at zugschlus.de
Tue Feb 14 15:46:21 UTC 2006
On Tue, Feb 14, 2006 at 10:40:38AM -0500, Roderick Schertler wrote:
> On Tue, 14 Feb 2006 15:55:58 +0100, Marc Haber <mh+debian-packages at zugschlus.de> said:
> > Still no response from Upstream. Just a hunch: Does it help to set
> > umask 022 in the init script?
>
> I haven't actually tested it, but I shouldn't think so. That's the mask
> that's already set when the init script is run. Plus, Exim sets it to 0
> on purpose (exim.c line 1438):
>
> /* Set the umask to zero so that any files that Exim creates are created
> with the modes that it specifies. */
>
> umask(0);
>
> then creates the files with fopen(), so they get 0666 & 0 == 0666
> (demime.c line 259 plus other places):
>
> *f = fopen(CS file_name,"wb+");
Ouch.
That sounds, however, reasonably easy fixable. I do not have too much
clue, but would it be enough to do something like
mode_t umask_save;
umask_save=umask(077);
fopen();
umask(umask_save);
for all fopen calls found in demime.c?
Greetins
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
More information about the Pkg-exim4-maintainers
mailing list