Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 566840 - app-misc/mc: copy does not honor setgid flag on target directory
Summary: app-misc/mc: copy does not honor setgid flag on target directory
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Sergei Trofimovich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-25 17:42 UTC by M. Prášek
Modified: 2019-11-03 10:51 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description M. Prášek 2015-11-25 17:42:45 UTC
I have a directory with setfacl and setgid flak on it so newly created stuff  inside directory have a set group as parent directory

mkdir foo
chmod g+s foo

when I try to copy by midnight commander ie select in one panel and directory foo in second panel as destination, even with the PRESERVE ATTRIBUTES  NOT checked,  newly created directories under foo does not have a  s  bit set .

Hovewer, copying the same things with plain cp source/* /path/to/foo work and s bit of foo directory is preserved on copied subdirs

I consider it is a bug. 
 

Reproducible: Always

Steps to Reproduce:
1.mkdir foo
2.chmod g+s foo
3. in mc select some files and directories as source
4. set preserve attributes as NOT checked and copy to foo


Actual Results:  

ls -al 
drwxrws--- foo
cd foo
ls -al 
all copied directories 
drwxrwx---  but not s 


Expected Results:  
newly created (ie copied) directories to foo/something to honour g+s of the parent directory, like plain cp does

version of mc = 4.8.15
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-22 14:30:29 UTC
(In reply to M. Prášek from comment #0)
> I have a directory with setfacl and setgid flak on it so newly created stuff
> inside directory have a set group as parent directory
> 
> mkdir foo
> chmod g+s foo
> 
> when I try to copy by midnight commander ie select in one panel and
> directory foo in second panel as destination, even with the PRESERVE
> ATTRIBUTES  NOT checked,  newly created directories under foo does not have
> a  s  bit set .
> 
> Hovewer, copying the same things with plain cp source/* /path/to/foo work
> and s bit of foo directory is preserved on copied subdirs
> 
> I consider it is a bug. 
>  
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1.mkdir foo
> 2.chmod g+s foo
> 3. in mc select some files and directories as source
> 4. set preserve attributes as NOT checked and copy to foo
> 
> 
> Actual Results:  
> 
> ls -al 
> drwxrws--- foo
> cd foo
> ls -al 
> all copied directories 
> drwxrwx---  but not s 
> 
> 
> Expected Results:  
> newly created (ie copied) directories to foo/something to honour g+s of the
> parent directory, like plain cp does
> 
> version of mc = 4.8.15

You have picked not to preserve attributes (I use this option to copy files over to FTP and other non-posix filesystems). I'm not sure what the semantics are here.

Can you file upstream bug report at https://midnight-commander.org/, explain your use case there and link the bug here?
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-03 10:51:38 UTC
Please file an upstream bug to clarify semantics. I'm not convinced it's a bug.