[SSSD] [PATCH] IPA: Securely set umask for mkstemp in subdomain provider

Stephen Gallagher sgallagh at redhat.com
Mon Aug 6 13:59:44 UTC 2012


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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120806/e8d4f028/attachment.sig>


More information about the sssd-devel mailing list