[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [Patch] let KSaveFile honor the umask
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2008-03-27 9:19:33
Message-ID: 200803271019.33130.t.zachmann () zagge ! de
[Download RAW message or body]

On Wednesday 26 March 2008, Thiago Macieira wrote:
> David Faure wrote:
> >On Wednesday 26 March 2008, Thiago Macieira wrote:
> >> Thorsten Zachmann wrote:
> >> >Hello all,
> >> >
> >> >KSaveFile does not honor the umask for newly created files. Looks
> >> > like this behaviour was introduces during the port to QTemporaryFile
> >> > which by default creates file with permissions 0600. This is good
> >> > for temporary files but for a file saved by an application it is
> >> > not. The attached patch changes the behaviour so that the KSaveFile
> >> > does honor the umask for files that are newly created.
> >> >
> >> >Ok to commit?
> >>
> >> By calling umask, you make the code thread-unsafe.
> >
> >Well, this code comes from ktempdir.cpp which uses umask too.
>
> And KTempDir was thread-unsafe.
>
> >And we never really checked which kdelibs classes are threadsafe, but
> > it's not too late to start I guess.
>
> True, but QTemporaryFile and KTemporaryFile are thread-safe now (to the
> best of my knowledge). This change of yours would break that.
>

how about using a mutex that will also catch the case where the umask is 
changed while the program is running?

Thorsten
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic