[OTR-dev] pidgin-otr: mode 600 instead of 644

Ian Goldberg ian at cypherpunks.ca
Tue Jun 17 17:48:31 EDT 2008


On Tue, Jun 17, 2008 at 05:27:06PM -0400, Ian Goldberg wrote:
> On Tue, Jun 17, 2008 at 11:17:14PM +0200, Caspar Clemens Mierau wrote:
> > > > Actually I even think that you are already fine using g_fopen under
> > > > Win32, but somebody needs to confirm this.
> > > 
> > > But there's no equivalent for umask, right?
> > 
> > Right. On Windows there is POSIX umask equivalent. There only exists a
> > readonly flag which poorly acts like a 444 mode. Glib therefore mostly
> > seems to ignore umask calls and only tries to set "readonly" when it
> > seems equivalent to the current umask.
> > 
> > If we want to be totally safe, we should check the platform and don't
> > call the umask when on Win32. Otherwise trusting glib documentation
> > actually prevents us from writing more code than actually necessary.
> 
> But the platform is determined at compile time.  So I think I'll just
> apply your patch, but with the new umask lines wrapped in:
> 
> #ifdef HAVE_UMASK
> 
> #endif  /* HAVE_UMASK */

Ah, no, I see that that's wrong.  Windows does in fact have the umask()
call; it just can't do something like 077.  Sorry I misunderstood
earlier.  So I need to wrap it in

#ifndef WIN32

#endif  /* WIN32 */

I suppose.

   - Ian



More information about the OTR-dev mailing list