! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar mask restrictions on group and other
Status:
RESOLVED: FIXED
Product:
Thunar-vfs
Component:
General

Comments

Description Zap-W 2007-09-04 13:37:24 CEST
Thunar dosen't allow write bit to be set on newly created files and dirs 
to groups and other. even with umask 0 set
Comment 1 Benedikt Meurer editbugs 2007-11-28 19:55:10 CET
Works perfectly. Maybe it's a restriction of the file system in use?
Comment 2 Craig Ringer 2008-06-25 07:43:29 CEST
Created attachment 1709 
Don't override user's preferred file/dir create mode

I can reproduce this on Ubuntu 8.10 (Hardy). The issue is in thunar-vfs. I've written and attached a patch.

See Launchpad bug 242842:

https://bugs.launchpad.net/ubuntu/+source/thunar/+bug/242842
Comment 3 Craig Ringer 2008-06-25 07:45:20 CEST
Just to clarify, I've reproduced and patched this in thunar 0.9.0-4ubuntu2 . The ubuntu package doesn't appear to apply any relevant patches.
Comment 4 Craig Ringer 2008-06-26 01:34:05 CEST
As for filesystem: the test system is a bog standard Ubuntu install, with all ext3  filesystems. In any case, thunar-vfs code is clearly just not requesting group write or world write permissions, so they're not being granted even if they're not masked out by the user's umask.

thunar-vfs should request group and world write and let the user's umask decide whether or not those should actually be granted.
Comment 5 Francesco Biccari 2008-06-28 09:16:44 CEST
I can reproduce this bug on my system.
My global umask is 0002.

When I create a file in Thunar, its permissions are 644 instead of 664.
When I create a directory in Thunar, its permissions are 755 instead of 775.

The same operations from command line give the correct result (664 for files and 775 for directories).

My system is a Gentoo on x86. Thunar version is 0.9.0 (Gentoo ebuild 0.9.0-r2)
Comment 6 Jelle de Jong 2008-10-07 08:31:22 CEST
I can also reproduce this bug on my system, it is preventing me from creating an good shared file system when clients are using thunar...

Could somebody please have a look at this? I can 100% reproduce the issue

thunar: debian sid: pool/main/t/thunar/thunar_0.9.0-10_i386.deb

Thanks in advance,
Comment 7 Giovanni Bechis 2009-03-03 14:14:50 CET
Created attachment 2212 
File creation when umask is different from 022 fix
Comment 8 Landry Breuil editbugs 2009-03-12 18:05:20 CET
The patch giovanni attached (he sent it to me first) definitely fixes the issue here after some testing, umask is correctly honoured. I'm going to commit it to OpenBSD's portstree.
Comment 9 Jannis Pohlmann editbugs 2009-03-12 18:16:49 CET
Thanks! I've committed Giovanni's patch in revision 29653:

        * thunar-vfs/thunar-vfs-io-jobs.c: Apply umask properly when
          creating files/directories. Patch by Giovanni Bechis (bug
          #3532
Comment 10 Francesco Biccari 2009-06-13 16:30:12 CEST
I think that the problem is not fixed.

I have set the umask value (0002) in /etc/profile and in /etc/login.defs.

Thunar still applies wrong permissions (0022).


Gentoo x86
Xfce 4.6.1
Thunar 1.0.1
Comment 11 Jannis Pohlmann editbugs 2009-10-03 09:38:53 CEST
Yes, the bug is not fixed yet. The patch which I applied for Thunar 1.0.x even makes things worse. Reopening the bug.
Comment 12 Jannis Pohlmann editbugs 2009-10-03 09:39:22 CEST
*** Bug 5813 has been marked as a duplicate of this bug. ***
Comment 13 Jannis Pohlmann editbugs 2009-10-03 10:50:21 CEST
And fixed again, this time with Craig's patch. Here's the log:

commit eb58c6a6ba7f77c2c16016db064524df598ef421
Author: Jannis Pohlmann <jannis@xfce.org>
Date:   Sat Oct 3 11:49:41 2009 +0200

    Fix bugs #3532 (umask < 0022 not honoured) and #5813 properly (I hope).
    
    The previous patch applied in e53de71e6add9b28ba034111a1d19db7def8f7e7
    made things worse than before: it used DEFFILEMODE which seems to be
    BSD-specific for creating files. It also reset the umask to 0 when
    creating the first directory with _thunar_vfs_io_jobs_mkdir().
    
    What we really want is to use 0777 (dirs) and 0666 (files) and let the
    standard C system calls like open() apply the umask value. This should
    work on all POSIX-compliant systems.
    
    Patch provided by Craig Ringer <craig@postnewspapers.com.au>.
Comment 14 Jannis Pohlmann editbugs 2009-10-03 10:51:48 CEST
*** Bug 5376 has been marked as a duplicate of this bug. ***
Comment 15 Cong Ma 2010-04-14 06:18:14 CEST
*** Bug 6389 has been marked as a duplicate of this bug. ***

Bug #3532

Reported by:
Zap-W
Reported on: 2007-09-04
Last modified on: 2010-11-07
Duplicates (3):
  • 5376 Thunar breaks umask after Create Folder operation
  • 5813 umask problems when starting as a daemon
  • 6389 Thunar 1.0 creates directories with permission mode 0777

People

Assignee:
Jannis Pohlmann
CC List:
9 users

Version

Version:
unspecified

Attachments

Additional information