Created attachment 404192 [details] Removing the incorrect handling of umask in _thunar_vfs_io_jobs_mkdir() Description of problem: The Thunar file manager creates new directories with permission 0777. This is surprising. It is almost certainly not what the user expects. Version-Release number of selected component (if applicable): Thunar-1.0.1-3.fc12.i686 Older versions may be affected too. How reproducible: Always. Steps to Reproduce: 1. Start Thunar 2. "File" menu -> "Create Folder" Actual results: The new directory is created with permission mode 0777. Expected results: It should have done what mkdir(1) does, i.e. letting mkdir(2) modify the permission mode 0777 with the user's default umask, which is The Right Thing. The created directory's permission mode should be (0777 & ~umask). Additional info: I took a casual look at the code. It seems to me that the author created an interesting bug by abusing umask(2). Here is the relevant code snippet: (in file Thunar-1.0.1/thunar-vfs/thunar-vfs-io-jobs.c, line 710) /* try to create the target directory */ if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777 & ~umask(0), THUNAR_VFS_IO_OPS_NONE, error)) return FALSE; I don't know what was in the coder's mind when he wrote this. Even if an empty umask is the desired thing, this call will only make the *second* run of _thunar_vfs_io_ops_mkdir() use the empty umask. In other words, this is just wrong. I've created a patch to remove this insanity. I tested it on my own computer and it looked fine to me ;)
Hum. I can't duplicate this here, nor have I seen any other reports. What is your umask set to? Is it something other than the default 022?
(In reply to comment #1) > Hum. I can't duplicate this here, For each Thunar process (incl. daemonized), the first directory created will not be affected. This bug only affects the second and later directories created in Thunar. > nor have I seen any other reports. XFCE userbase is too small in size compared with GNOME or KDE, and bugs take longer to get noticed... > What is your umask set to? Is it something other than the default 022? No. It's 022.
Oops. I am just blind... it was fixed upstream a while back, there just haven't been any Thunar releases since then. ;( See http://bugzilla.xfce.org/show_bug.cgi?id=3532 I'll look at applying the upstream patch here soon. Thanks for the report.
(In reply to comment #3) > Oops. I am just blind... it was fixed upstream a while back, there just haven't > been any Thunar releases since then. ;( > > See http://bugzilla.xfce.org/show_bug.cgi?id=3532 > > I'll look at applying the upstream patch here soon. > > Thanks for the report. Fine. I'm glad to know there's a upstream fix. Please ignore my patch and use the upstream one (http://git.xfce.org/xfce/thunar/commit/?id=eb58c6a6ba7f77c2c16016db064524df598ef421). Heck, I even opened a bug report over there. Moving off to xfce.org and closing that one :p
Thunar-1.0.1-6.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/Thunar-1.0.1-6.fc13
Thunar-1.0.1-6.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/Thunar-1.0.1-6.fc12
Thanks for the update. It works ;)
Thunar-1.0.1-6.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update Thunar'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/Thunar-1.0.1-6.fc13
Thunar-1.0.1-6.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update Thunar'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/Thunar-1.0.1-6.fc12
Thunar-1.0.1-6.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
Thunar-1.0.2-3.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/Thunar-1.0.2-3.fc13
(In reply to comment #11) > Thunar-1.0.2-3.fc13 has been submitted as an update for Fedora 13. > https://admin.fedoraproject.org/updates/Thunar-1.0.2-3.fc13 Thunar 1.0.2-2.fc13 creates directories with umask 776
(In reply to comment #12) > (In reply to comment #11) > > Thunar-1.0.2-3.fc13 has been submitted as an update for Fedora 13. > > https://admin.fedoraproject.org/updates/Thunar-1.0.2-3.fc13 > > Thunar 1.0.2-2.fc13 creates directories with umask 776 Sorry, Thunar 1.0.2-2.fc13 creates directories with umask 775
Odd. 1.0.2 has the patch for this. I'll try and duplicate. What is your umask set to? You see this on every directory create after the first one?
(In reply to comment #14) > Odd. 1.0.2 has the patch for this. > > I'll try and duplicate. What is your umask set to? You see this on every > directory create after the first one? Umask command tell me: 0002. I don't know what it means. I have created three directory from the top menu File and three directory from the right menu (with the mouse) and the command "ls -l" tell me: drwxrwxr-x 2 francesco francesco 4096 19 ott 18:26 xxxxx drwxrwxr-x 2 francesco francesco 4096 19 ott 18:26 xxxxx3 drwxrwxr-x 2 francesco francesco 4096 19 ott 18:26 xxxxx4 drwxrwxr-x 2 francesco francesco 4096 19 ott 18:26 yyyy3 drwxrwxr-x 2 francesco francesco 4096 19 ott 18:26 yyyyy1 drwxrwxr-x 2 francesco francesco 4096 19 ott 18:26 yyyyy2 My settings are Fedora 13 defaults.
Thats correct when your umask is 0002. The default umask used to be 0022, but I guess it's not anymore. So, these permissions look ok to me, what issues are you seeing due to them?
(In reply to comment #16) > Thats correct when your umask is 0002. > > The default umask used to be 0022, but I guess it's not anymore. > > So, these permissions look ok to me, what issues are you seeing due to them? Not any issue, i'm telling that that version of Thunar, 1.0.2-2.fc13, creates directoies with the right permission. I don't have changed the default umask into my Fedora 13 installation and tha patch proposed to solve the permission issue could be wrong for me. I only warned of possible error. I have no issues.
Thunar-1.0.2-3.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.