Thunar sets wrong permissions for new files and directories (666, 777)

Bug #391969 reported by stitch on 2009-06-25
264
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Thunar File Manager
Unknown
Unknown
thunar (Ubuntu)
Medium
Lionel Le Folgoc

Bug Description

Ubuntu Jaunty: When creating a new directory with thunar the first time during an X session, the permission is 755. But if the second directory is created, its permission is 777 and now, file permissions for new files are 666. Using a terminal, the expected permissions (755 and 644) are used. Starting thunar from the terminal does not solve the problem.

stitch (grubert-physik) on 2009-06-25
visibility: private → public
Jamie Strandboge (jdstrand) wrote :

This is confirmed on Karmic. Steps to reproduce:

1. create a toplevel directory under $HOME (eg 'foo')
2. create a file in the 'foo' directory
$ ls -ld /home/jamie/foo/ /home/jamie/foo/bar
drwxrwxrwx 2 jamie jamie 4096 2009-06-26 10:06 /home/jamie/foo/
-rw-rw-rw- 1 jamie jamie 0 2009-06-26 10:06 /home/jamie/foo/bar
$ umask
0022

At the very least, thunar should honor umask.

Changed in thunar (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Urs Fleisch (ufleisch) wrote :

There is a patch in the source packet, debian/patches/03_thunar-vfs-apply-umask-properly.patch, which changes

if (!_thunar_vfs_io_ops_mkdir (lp->data, 0755, THUNAR_VFS_IO_OPS_NONE, error))

to

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

But this does not really apply umask properly, because the call to umask(0) will set the umask to 0 and return the old umask. mkdir() already respects the umask (see "man 2 umask" and "man 2 mkdir"). The correct line would probably be:

if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777, THUNAR_VFS_IO_OPS_NONE, error))

This is also in the patch at http://bugs.gentoo.org/275516

Charlie Kravetz (charlie-tca) wrote :

Thank you for your bug report. This bug has been reported to the developers of the software. You can track it and make comments at:

Changed in thunar (Ubuntu):
status: Confirmed → Triaged
Charlie Kravetz (charlie-tca) wrote :

Thank you for your bug report. This bug has been reported to the developers of the software. You can track it and make comments at: http://bugzilla.xfce.org/show_bug.cgi?id=5376

Changed in thunar (Ubuntu):
status: Triaged → Fix Committed
assignee: nobody → Lionel Le Folgoc (mrpouit)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package thunar - 1.0.1-1ubuntu2

---------------
thunar (1.0.1-1ubuntu2) karmic; urgency=low

  * debian/patches/xubuntu-fix-desktop-files.patch: updated to hide Bulk Rename
    from the menu. LP: #441278
  * debian/patches/04_fix-umask-handling.patch: fix wrong permissions for new
    files and folders. LP: #391969

 -- Lionel Le Folgoc <email address hidden> Sat, 03 Oct 2009 15:45:53 +0200

Changed in thunar (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.