Bug 1038442 - chown() does not clear suid bit
Summary: chown() does not clear suid bit
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: access-control
Version: mainline
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Jiffin
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-05 06:34 UTC by Anand Avati
Modified: 2018-10-12 15:30 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.12.13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-12 15:30:36 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Anand Avati 2013-12-05 06:34:38 UTC
Description of problem:

chown() should clear setuid, and if not group executable must clear setgid as well. glusterfs does not do so.

Version-Release number of selected component (if applicable):


How reproducible:

Always


Steps to Reproduce:
1. chmod +s file
2. chown newuser file
3. ls -l file

Actual results:

setuid bit is still there

Expected results:

setuid bit should not be there

Additional info:

Comment 1 Anand Avati 2013-12-05 07:31:39 UTC
REVIEW: http://review.gluster.org/6436 (posix-acl: clear SUID and SGID bits on chown() by non-root) posted (#1) for review on master by Anand Avati (avati@redhat.com)

Comment 2 Anand Avati 2013-12-05 07:33:15 UTC
Steps to Reproduce:
1. chmod +s dir
2. chown newuser dir
3. ls -ld dir

Comment 5 Mike McCune 2016-03-28 23:43:17 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions

Comment 6 Worker Ant 2017-07-19 08:38:50 UTC
REVIEW: https://review.gluster.org/6436 (posix-acl: clear SUID and SGID bits on chown() by non-root) posted (#2) for review on master by Raghavendra G (rgowdapp@redhat.com)

Comment 7 Amar Tumballi 2018-09-18 09:28:20 UTC
The posted patch would need a rebase to handle clang-format changes etc.

Comment 8 Worker Ant 2018-10-10 16:12:40 UTC
REVIEW: https://review.gluster.org/6436 (posix-acl: clear SUID and SGID bits on chown() by non-root) posted (#3) for review on master by Varsha Rao

Comment 9 Varsha 2018-10-12 11:22:48 UTC
This bug is already fixed and patch is no longer required.
With or without the patch setuid bit is cleared by chown.

The test case introduced by the patch for this bug is successful without the patch too.


Note You need to log in before you can comment on or make changes to this bug.