[SSSD] [PATCH] IPA: Securely set umask for mkstemp in subdomain provider
Jakub Hrozek
jhrozek at redhat.com
Mon Aug 6 16:15:25 UTC 2012
On Mon, Aug 06, 2012 at 09:59:44AM -0400, Stephen Gallagher wrote:
> On Mon, 2012-08-06 at 09:56 -0400, Simo Sorce wrote:
> > On Mon, 2012-08-06 at 09:47 -0400, Stephen Gallagher wrote:
> > > Fixes https://fedorahosted.org/sssd/ticket/1457
> > >
> > > The permissions are later set with chmod() to the final values after
> > > it's moved to the real filename, so this is safe.
> >
> > What't the point ?
> >
> > The default umask is already ok (strict), I asked Jakub to not set/unset
> > the umask in his last patch exactly because we are going to do a chmod
> > later anyway.
>
>
> The default umask is 022, that's not okay for a root process, IMHO.
>
> Furthermore, Coverity is complaining about this. And lastly, what harm
> is there in being overcautious?
I agree, this would also cover very old (or very broken) systems that
didn't set the default umask in msktemp.
Ack.
More information about the sssd-devel
mailing list