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 579806 - copies don't respect setuid and setgid settings
copies don't respect setuid and setgid settings
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: Navigation
2.30.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-22 07:48 UTC by sylvain just
Modified: 2021-06-18 15:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30



Description sylvain just 2009-04-22 07:48:57 UTC
Please describe the problem:
When I copy-paste or drag'n drop from nautilus to a directory with setgid enabled, directories or files moved/copied keep old owner group and old permissions (without setgid bit).

Steps to reproduce:
1. Create users, groups, and common directory (with good permissions -setgid enabled).
I have 2 users : user-a and user-b (with respective first group: groups group-a and group-b)
they are both in third group named common-group :

~$ id user-a
uid=1001(user-a) gid=1001(group-a) groupes=1001(group-a),1004(common-group)
~$ id user-b
uid=1002(user-b) gid=1001(group-a) groupes=1001(group-a),1004(common-group)

Their own HomeDirectory are : (ls -ld /home/user*)
drwxrwx--- 5 user-a group-a 4096 2009-04-20 14:00 user-a
drwxrwx--- 5 user-b group-b 4096 2009-04-20 14:02 user-b
and umask 007 (in .bashrc)

The common directory : (ls -ld /home/common*)
drwxrws--- 2 root common-group 4096 2009-04-20 14:03 common-directory
(chmod 2770)



2. Create files and directories to copy-paste / drag'n drop
~$ ls -l /home/*
/home/common-directory/:
total 0

/home/user-a/:
total 4
drwxrwx--- 2 user-a group-a 4096 2009-04-21 17:07 user-a.dir
-rw-rw---- 1 user-a group-a 0 2009-04-21 17:08 user-a.file

/home/user-b/:
total 4
drwxrwx--- 2 user-b group-b 4096 2009-04-21 17:07 user-b.dir
-rw-rw---- 1 user-b group-b 0 2009-04-21 17:07 user-b.file

3. Copy-paste or drag'n drop from nautilus interface log in as user-b
When I'm log in gnome with User "user-b" and I copy paste through nautilus the files in my home directory, the result is bellow :

user-b: ~$ ls -l ../common-directory/
total 4
drwxrwx--- 2 user-b common-group 4096 2009-04-21 17:24 user-b.dir
-rw-rw---- 1 user-b group-b 0 2009-04-21 17:24 user-b.file

Actual results:
Then, owner group isn't good for file copied from nautilus interface and setgid bit isn't present for direcory copied...

Expected results:
whereas I would expect have something like when I use CLI (mv or cp) : setgid enabled on directory copied and group of parent directory inherited for directory and file copied =>

~$ su user-a
user-a: ~$ umask
0007
user-a: ~$ cp -rv * ../common-directory/
`user-a.dir' -> `../common-directory/user-a.dir'
`user-a.file' -> `../common-directory/user-a.file'
user-a: ~$ ls -l ../common-directory/
total 8
drwxrws--- 2 user-a common-group 4096 2009-04-21 17:15 user-a.dir
-rw-rw---- 1 user-a common-group 0 2009-04-21 17:15 user-a.file
drwxrwx--- 2 user-b common-group 4096 2009-04-21 17:24 user-b.dir
-rw-rw---- 1 user-b group-b 0 2009-04-21 17:24 user-b.file

Does this happen every time?
This Problem is same for a deported or local filesystem (nfs / two local partition of a same hard drive / two directories of a same parititon / a local parititon and an usb key).

Other information:
When I copy or move some files or directories from the HomeDirectories with CLI (cp or mv), setgid bit is preserved and owner group too.

NB: I tried to use gvfs-copy command. Result is good for file (good owner group, good permissions) but with directory, error message is :
"Impossible to copy a repertory recursively"
Comment 1 sylvain just 2009-05-05 09:02:14 UTC
I'm on Ubuntu 8.10 with 2.6.27-11-generic linux kernel
Comment 2 Marcelo Andrade 2010-09-14 14:18:45 UTC
I can confirm this bug happening on Ubuntu Hardy Heron (8.04).

Please ask for any other input needed and I'll provide it.
Comment 3 tsalomon 2011-01-20 19:19:26 UTC
I confirm that this happens exactly the same way on Ubuntu Lucid 10.04 too.

gnome 2.30
libgnomevfs 2.24
nautilus 2.30
Comment 4 André Klapper 2011-08-11 12:39:15 UTC
[Bumping version number as per comment 3]
Comment 5 André Klapper 2021-06-18 15:17:14 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of Files (nautilus), then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/nautilus/-/issues/

Thank you for your understanding and your help.