Comment 10 for bug 242842

Revision history for this message
Craig Ringer (ringerc) wrote :

Michael:

Yep, that's ugly. It actually is properly associated with this bug, too, as the patch Debian and Ubuntu have for Thunar is completely borked.

The umask patch:
  http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/jaunty/thunar/jaunty/revision/58
is at fault for this. It calls:

   umask(0)

thus changing the user's umask (wtf?!?). It does so in a really bizarre way:

+ if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777 & ~umask(0), THUNAR_VFS_IO_OPS_NONE, error))

... that makes me think that whoever wrote that completely fails to understand how the umask works and what it does. People seem to be unable to understand that *they* *don't* *have* *to* *mess* *with* *the* *umask*. It's a *mask* and is applied automatically by libc to mask out disallowed permissions bits, so the app just asks for the most general permissions that make sense (0666 for files, 0777 for dirs) unless it has a really good reason (like creating a file to contain a private key) not to.

My original patch for this issue works fine and gets this right. I have no idea why the above was used instead. Karmic carries a correct patch; the same patch just needs to be applied to Jaunty.