After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317664 - Consider umask in create_directory from gnome-vfs-xfer
Consider umask in create_directory from gnome-vfs-xfer
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Async operations
2.13.x
Other All
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-01 07:30 UTC by Jp Senior
Modified: 2006-01-17 08:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Jp Senior 2005-10-01 07:30:30 UTC
Please describe the problem:
I am unable to force nautilus to create folders in any mode other than 775 when
using 'umask'.

I am using Gnome version 2.10.0, Nautilus version 2.10.0, for Ubuntu 5.04 Hoary.



Steps to reproduce:
sartan@solar:~$ umask 0002
sartan@solar:~$ mkdir testone
sartan@solar:~$ ls -lah | grep testone
drwxrwxr-x   2 sartan sartan 4.0K 2005-10-01 01:14:14 test
[775]

sartan@solar:~$ umask 0002
sartan@solar:~$ gedit
	[within gedit:]
	file, save as.  'Browse for other folders'.  'Create Folder' with the name of
'testtwo'.  Exit gedit.
sartan@solar:~$ ls -lah | grep testtwo
drwxrwxr--    2 sartan sartan 4.0K 2005-10-01 01:15:13 testtwo
[774]

(I understand that we actually have umask 0774 but I assume this is related to
bug http://bugzilla.gnome.org/show_bug.cgi?id=109176 somehow)

sartan@solar:~$ umask 0002
sartan@solar:~$ nautilus
	[within nautilus:]
	right-click anywhere, 'new folder', 'testthree'.  Exit nautilus
sartan@solar:~$ ls -lah | grep testthree
drwxr-xr-x    2 sartan sartan 4.0K 2005-10-01 15:17:24 testthree
[755]




Actual results:
Folders are created with octal permissions 755 when I am expecting 775.

Folders are *always* created 755 unless they are setgid setuid or stickied - but
then only the setuid changes, (IE 1755 6755) likely due to the filesystem.

Expected results:
I should expect nautilus to accurately follow the 'umask' settings.  In this
case, I should be able to create a folder with octal permissions 0775.



Does this happen every time?
Yes, this happens every time.

Other information:
This behaviour is not seen in other gnome applications (Such as gedit).  Folders
are created with the correct octal permissions.

[Is the Gnome "File Browse" window also bugged when it comes to umask?  774 is
completely unexpected .  Using umask 000 fixed this.  I assume this is by
design?  See bug http://bugzilla.gnome.org/show_bug.cgi?id=109176 for an
explaination.  Is it adding umask bits arbitrarily?  Do I need to be filing
another bug pointing to unexpected umask behaviour under normal conditions?]
Comment 1 Benoît Dejean 2005-10-18 02:58:02 UTC
i can't reproduce with 2.12.1
Comment 2 Yves-Gwenael Bourhis 2005-11-16 09:30:38 UTC
I confirm the problem on Gnome 2.10 whatever distro:

See below, "test*" have been created with respectively "touch" and "mkdir", and
"Nouveau*" have been created with nautilus.
Directories are respectful to umask,SGID and Acls, but not ordinary files.

here is what I get on Mandriva 2006 (nautilus 2.10.1-9mdk):
http://qa.mandriva.com/show_bug.cgi?id=19799

And on an Ubuntu 5.04 Hoary (2.10.0-0ubuntu9) SGID isn't even respected:

Parent directory is SGID
umask 022

drwxrws---+ 2 yves    qa  48 2005-11-15 20:58 nouveau dossier
-rw-------+ 1 yves    yves      0 2005-11-15 20:58 nouveau fichier
-rw-rw----+ 1 yves    qa   0 2005-11-15 20:58 test
drwxrws---+ 2 yves    qa  48 2005-11-15 20:58 test2
Comment 3 Yves-Gwenael Bourhis 2006-01-02 08:59:39 UTC
Comment #1:
I still get the bug on Gnome 2.12.0 (Mandriva 2006 Club).

I admit that I didn't try 2.12.1 yet.
Comment 4 Christian Neumair 2006-01-06 11:34:43 UTC
I think GnomeVFS should consider the umask when calling gnome_vfs_make_directory_for_uri in create_directory from gnome-vfs-xfer.c.



Also note that the problem with your testing routines is that you set the umask and then try to launch Nautilus from a shell, which actually makes the running instance of Nautilus open the desired location. If you set the umask before launching the Nautilus master instance, or remove Nautilus from your GNOME session, and enter in a terminal

NAUTILUS_DEBUG=1 nautilus

you'll have Nautilus running in your shell obeying your umask (if it worked correctly, cf. above).


I'm reassigning this one to GnomeVFS
Comment 5 Christian Neumair 2006-01-06 12:00:31 UTC
Hrm I'm resolving this as fixed because for the "file:///" method, create_directory will endup in the glibc mkdir which respects the umask. So after doing what I described your Nautilus-driven mkdir should work as expected.
Comment 6 Yves-Gwenael Bourhis 2006-01-17 08:43:25 UTC
Having "file:///" method, create_directory to endup in the glibc mkdir which respects the umask" will probably fix the "Create a directory" problem, but I doubt it will it also solve the file creation problem?

As I discribe above "create a blank Document" <> "touch command" and that also didn't respect the UMASK and ACLs.

in Comment #2, the "nouveau dossier" is a directory created with nautilus and "nouveau fichier" a file created with nautilus. "test" is created with "touch" and "test2" with mkdir". The problem is when creating a blank document as you can see in Comment #2

Concerning Comment #4 I don't launch nautilus from the shell, but from the gnome menus (to be in respect with what a ordinary user would do).