Bug 761804 (GLUSTER-72)

Summary: items created in setgid directories do not inherit group ID
Product: [Community] GlusterFS Reporter: Basavanagowda Kanur <gowda>
Component: coreAssignee: Anand Avati <aavati>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: caleb.tennis, chrisw, gluster-bugs, vikas
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Caleb Tennis 2009-06-25 06:36:18 UTC
*** Bug 56 has been marked as a duplicate of this bug. ***

Comment 1 Basavanagowda Kanur 2009-06-25 07:13:12 UTC
[Migrated from savannah BTS] - bug 26778 [https://savannah.nongnu.org/bugs/index.php?26778]

Wed 10 Jun 2009 11:29:30 PM GMT, original submission by Alex Kompel <shurikk>:

Items create in directories with setgid flag set do not inherit parent directory group id.

Steps to reproduce:
------------------
mkdir 1
chgrp someothergroup 1
chmod g+s 1
ls -ld 1
cd 1
mkdir 2
ls -ld 2

expected: 2 groupid should be someothergroup

By looking at strace it appears that glusterfs calls chown immediately after mkdir and overrides group ID.

[pid 2908] mkdir("/data1/glusterfsvol/shared/1", 0755 <unfinished ...>
[pid 2914] <... stat resumed> {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
[pid 2908] <... mkdir resumed> ) = 0
[pid 2914] stat("/data1", <unfinished ...>
[pid 2908] chown("/data1/glusterfsvol/shared/1", 0, 0 <unfinished ...>
[pid 2914] <... stat resumed> {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 2908] <... chown resumed> ) = 0
[pid 2914] close(53 <unfinished ...>
[pid 2908] lstat("/data1/glusterfsvol/shared/1", <unfinished ...>
[pid 2914] <... close resumed> ) = 0
[pid 2908] <... lstat resumed> {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, ...}) = 0

test config:
-------------------------------
volume posix
type storage/posix
option directory /data1/glusterfsvol
end-volume

volume locks
type features/locks
subvolumes posix
end-volume

volume brick
type performance/io-threads
subvolumes locks
end-volume

volume server
type protocol/server
option transport-type tcp
option auth.addr.brick.allow *
subvolumes brick
end-volume

volume cs0301
type protocol/client
option transport-type tcp
option remote-host cs0301
option remote-subvolume brick
end-volume

volume cs0302
type protocol/client
option transport-type tcp
option remote-host cs0302
option remote-subvolume brick
end-volume

volume cs
type cluster/nufa
option local-volume-name `hostname` # note the backquote, so 'hostname' output will be used as the option.
subvolumes cs0301 cs0302
end-volume

volume cache
type performance/io-cache
option cache-size 512MB
subvolumes cs
end-volume

--------------------------------------------------------------------------------
Fri 12 Jun 2009 06:41:20 PM GMT, comment #1 by Caleb Tennis <ctennis>:

I can confirm this behavior with one of our systems as well.

--------------------------------------------------------------------------------
Fri 12 Jun 2009 09:05:40 PM GMT, comment #2 by 	Caleb Tennis <ctennis>:

Note: this issue is also present in 1.3

Comment 2 Vikas Gorur 2009-09-04 06:26:17 UTC

*** This bug has been marked as a duplicate of bug 241 ***