All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file
@ 2016-08-23 21:51 Andreas Gruenbacher
  2016-08-23 22:05 ` Andreas Gruenbacher
  2016-08-24  9:28 ` Eryu Guan
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Gruenbacher @ 2016-08-23 21:51 UTC (permalink / raw)
  To: fstests; +Cc: Andreas Gruenbacher, Jan Kara

Check if SGID is cleared upon chmod / setfacl when the owner is not in
the owning group.  As of today, the kernel fails to clear SGID in
setxattr (which is what acl_set_file is implemented on top of) in that
case; see this patch:
  https://patchwork.kernel.org/patch/9290507/

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Jan Kara <jack@suse.cz>
---
 tests/generic/375     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/375.out |  9 ++++++
 tests/generic/group   |  1 +
 3 files changed, 90 insertions(+)
 create mode 100755 tests/generic/375
 create mode 100644 tests/generic/375.out

diff --git a/tests/generic/375 b/tests/generic/375
new file mode 100755
index 0000000..9976c3d
--- /dev/null
+++ b/tests/generic/375
@@ -0,0 +1,80 @@
+#! /bin/bash
+# FS QA Test 375
+#
+# Check if SGID is cleared upon chmod / setfacl when the owner is not in the
+# owning group.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat.  All Rights Reserved.
+#
+# Author: Andreas gruenbacher <agruenba@redhat.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os Linux
+_require_test
+_require_runas
+
+cd $TEST_DIR
+rm -f testfile
+
+touch testfile
+chown 100:100 testfile
+
+echo '*** SGID should remain set (twice)'
+chmod 2755 testfile
+_runas -u 100 -g 100 -- chmod 2777 testfile
+stat -c %A testfile
+chmod 2755 testfile
+_runas -u 100 -g 100 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
+stat -c %A testfile
+
+echo '*** SGID should be cleared (twice)'
+chmod 2755 testfile
+_runas -u 100 -g 101 -- chmod 2777 testfile
+stat -c %A testfile
+chmod 2755 testfile
+_runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
+stat -c %A testfile
+
+echo '*** Expected failure'
+_runas -u 101 -g 101 -- chmod 2777 testfile
+
+status=0
+exit
diff --git a/tests/generic/375.out b/tests/generic/375.out
new file mode 100644
index 0000000..fe812f3
--- /dev/null
+++ b/tests/generic/375.out
@@ -0,0 +1,9 @@
+QA output created by 375
+*** SGID should remain set (twice)
+-rwxrwsrwx
+-rwxrwsrwx
+*** SGID should be cleared (twice)
+-rwxrwxrwx
+-rwxrwxrwx
+*** Expected failure
+chmod: changing permissions of 'f': Operation not permitted
diff --git a/tests/generic/group b/tests/generic/group
index ef38c35..2d833a2 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -377,3 +377,4 @@
 372 auto quick clone
 373 auto quick clone
 374 auto quick clone dedupe
+375 auto quick acl
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file
  2016-08-23 21:51 [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file Andreas Gruenbacher
@ 2016-08-23 22:05 ` Andreas Gruenbacher
  2016-08-24  9:28 ` Eryu Guan
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Gruenbacher @ 2016-08-23 22:05 UTC (permalink / raw)
  To: fstests; +Cc: Andreas Gruenbacher, Jan Kara

On Tue, Aug 23, 2016 at 11:51 PM, Andreas Gruenbacher
<agruenba@redhat.com> wrote:
> Check if SGID is cleared upon chmod / setfacl when the owner is not in
> the owning group.  As of today, the kernel fails to clear SGID in
> setxattr (which is what acl_set_file is implemented on top of) in that
> case; see this patch:
>   https://patchwork.kernel.org/patch/9290507/
>
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> Cc: Jan Kara <jack@suse.cz>
> ---
>  tests/generic/375     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/375.out |  9 ++++++
>  tests/generic/group   |  1 +
>  3 files changed, 90 insertions(+)
>  create mode 100755 tests/generic/375
>  create mode 100644 tests/generic/375.out
>
> diff --git a/tests/generic/375 b/tests/generic/375
> new file mode 100755
> index 0000000..9976c3d
> --- /dev/null
> +++ b/tests/generic/375
> @@ -0,0 +1,80 @@
> +#! /bin/bash
> +# FS QA Test 375
> +#
> +# Check if SGID is cleared upon chmod / setfacl when the owner is not in the
> +# owning group.
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2016 Red Hat.  All Rights Reserved.
> +#
> +# Author: Andreas gruenbacher <agruenba@redhat.com>
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1       # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +       cd /
> +       rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs generic
> +_supported_os Linux
> +_require_test
> +_require_runas
> +
> +cd $TEST_DIR
> +rm -f testfile
> +
> +touch testfile
> +chown 100:100 testfile
> +
> +echo '*** SGID should remain set (twice)'
> +chmod 2755 testfile
> +_runas -u 100 -g 100 -- chmod 2777 testfile
> +stat -c %A testfile
> +chmod 2755 testfile
> +_runas -u 100 -g 100 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
> +stat -c %A testfile
> +
> +echo '*** SGID should be cleared (twice)'
> +chmod 2755 testfile
> +_runas -u 100 -g 101 -- chmod 2777 testfile
> +stat -c %A testfile
> +chmod 2755 testfile
> +_runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
> +stat -c %A testfile
> +
> +echo '*** Expected failure'
> +_runas -u 101 -g 101 -- chmod 2777 testfile
> +
> +status=0
> +exit
> diff --git a/tests/generic/375.out b/tests/generic/375.out
> new file mode 100644
> index 0000000..fe812f3
> --- /dev/null
> +++ b/tests/generic/375.out
> @@ -0,0 +1,9 @@
> +QA output created by 375
> +*** SGID should remain set (twice)
> +-rwxrwsrwx
> +-rwxrwsrwx
> +*** SGID should be cleared (twice)
> +-rwxrwxrwx
> +-rwxrwxrwx
> +*** Expected failure
> +chmod: changing permissions of 'f': Operation not permitted

Argh, the above should have been:

chmod: changing permissions of 'testfile': Operation not permitted

> diff --git a/tests/generic/group b/tests/generic/group
> index ef38c35..2d833a2 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -377,3 +377,4 @@
>  372 auto quick clone
>  373 auto quick clone
>  374 auto quick clone dedupe
> +375 auto quick acl
> --
> 2.7.4
>

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file
  2016-08-23 21:51 [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file Andreas Gruenbacher
  2016-08-23 22:05 ` Andreas Gruenbacher
@ 2016-08-24  9:28 ` Eryu Guan
  2016-08-24  9:48   ` Andreas Gruenbacher
  1 sibling, 1 reply; 5+ messages in thread
From: Eryu Guan @ 2016-08-24  9:28 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: fstests, Jan Kara

On Tue, Aug 23, 2016 at 11:51:39PM +0200, Andreas Gruenbacher wrote:
> Check if SGID is cleared upon chmod / setfacl when the owner is not in
> the owning group.  As of today, the kernel fails to clear SGID in
> setxattr (which is what acl_set_file is implemented on top of) in that
> case; see this patch:
>   https://patchwork.kernel.org/patch/9290507/
> 
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> Cc: Jan Kara <jack@suse.cz>
> ---
>  tests/generic/375     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/375.out |  9 ++++++
>  tests/generic/group   |  1 +
>  3 files changed, 90 insertions(+)
>  create mode 100755 tests/generic/375
>  create mode 100644 tests/generic/375.out
> 
> diff --git a/tests/generic/375 b/tests/generic/375
> new file mode 100755
> index 0000000..9976c3d
> --- /dev/null
> +++ b/tests/generic/375
> @@ -0,0 +1,80 @@
> +#! /bin/bash
> +# FS QA Test 375
> +#
> +# Check if SGID is cleared upon chmod / setfacl when the owner is not in the
> +# owning group.
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2016 Red Hat.  All Rights Reserved.
> +#
> +# Author: Andreas gruenbacher <agruenba@redhat.com>
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs generic
> +_supported_os Linux
> +_require_test
> +_require_runas

Need a "_require_acls", and need to source common/attr first to use
_require_acls.

> +
> +cd $TEST_DIR
> +rm -f testfile

I'd be better to name "testfile" with a test-specific prefix or suffix,
e.g. testfile.$seq, so we can know it's from test $seq.

I can fix these two nitpicks at commit time, if there's no new review
comments from others.

> +
> +touch testfile
> +chown 100:100 testfile
> +
> +echo '*** SGID should remain set (twice)'
> +chmod 2755 testfile
> +_runas -u 100 -g 100 -- chmod 2777 testfile
> +stat -c %A testfile
> +chmod 2755 testfile
> +_runas -u 100 -g 100 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
> +stat -c %A testfile

I noticed that NFSv4 cleared sgid bit on setfacl above, where the sgid
bit should stay, maybe an NFS bug?

[root@bootp-73-5-205 xfstests]# diff -u tests/generic/376.out /root/xfstests/results//generic/376.out.bad
--- tests/generic/376.out       2016-08-24 16:56:42.522000000 +0800
+++ /root/xfstests/results//generic/376.out.bad 2016-08-24 16:58:15.771000000 +0800
@@ -1,7 +1,7 @@
 QA output created by 376
 *** SGID should remain set (twice)
 -rwxrwsrwx
--rwxrwsrwx
+-rwxrwxrwx
 *** SGID should be cleared (twice)
 -rwxrwxrwx
 -rwxrwxrwx

Thanks,
Eryu

> +
> +echo '*** SGID should be cleared (twice)'
> +chmod 2755 testfile
> +_runas -u 100 -g 101 -- chmod 2777 testfile
> +stat -c %A testfile
> +chmod 2755 testfile
> +_runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
> +stat -c %A testfile
> +
> +echo '*** Expected failure'
> +_runas -u 101 -g 101 -- chmod 2777 testfile
> +
> +status=0
> +exit
> diff --git a/tests/generic/375.out b/tests/generic/375.out
> new file mode 100644
> index 0000000..fe812f3
> --- /dev/null
> +++ b/tests/generic/375.out
> @@ -0,0 +1,9 @@
> +QA output created by 375
> +*** SGID should remain set (twice)
> +-rwxrwsrwx
> +-rwxrwsrwx
> +*** SGID should be cleared (twice)
> +-rwxrwxrwx
> +-rwxrwxrwx
> +*** Expected failure
> +chmod: changing permissions of 'f': Operation not permitted
> diff --git a/tests/generic/group b/tests/generic/group
> index ef38c35..2d833a2 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -377,3 +377,4 @@
>  372 auto quick clone
>  373 auto quick clone
>  374 auto quick clone dedupe
> +375 auto quick acl
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file
  2016-08-24  9:28 ` Eryu Guan
@ 2016-08-24  9:48   ` Andreas Gruenbacher
  2016-08-24  9:56     ` Eryu Guan
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Gruenbacher @ 2016-08-24  9:48 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests, Jan Kara

Eryu,

On Wed, Aug 24, 2016 at 11:28 AM, Eryu Guan <eguan@redhat.com> wrote:
> On Tue, Aug 23, 2016 at 11:51:39PM +0200, Andreas Gruenbacher wrote:
>> Check if SGID is cleared upon chmod / setfacl when the owner is not in
>> the owning group.  As of today, the kernel fails to clear SGID in
>> setxattr (which is what acl_set_file is implemented on top of) in that
>> case; see this patch:
>>   https://patchwork.kernel.org/patch/9290507/
>>
>> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
>> Cc: Jan Kara <jack@suse.cz>
>> ---
>>  tests/generic/375     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  tests/generic/375.out |  9 ++++++
>>  tests/generic/group   |  1 +
>>  3 files changed, 90 insertions(+)
>>  create mode 100755 tests/generic/375
>>  create mode 100644 tests/generic/375.out
>>
>> diff --git a/tests/generic/375 b/tests/generic/375
>> new file mode 100755
>> index 0000000..9976c3d
>> --- /dev/null
>> +++ b/tests/generic/375
>> @@ -0,0 +1,80 @@
>> +#! /bin/bash
>> +# FS QA Test 375
>> +#
>> +# Check if SGID is cleared upon chmod / setfacl when the owner is not in the
>> +# owning group.
>> +#
>> +#-----------------------------------------------------------------------
>> +# Copyright (c) 2016 Red Hat.  All Rights Reserved.
>> +#
>> +# Author: Andreas gruenbacher <agruenba@redhat.com>
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation.
>> +#
>> +# This program is distributed in the hope that it would be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write the Free Software Foundation,
>> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>> +#-----------------------------------------------------------------------
>> +#
>> +
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmp=/tmp/$$
>> +status=1     # failure is the default!
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +_cleanup()
>> +{
>> +     cd /
>> +     rm -f $tmp.*
>> +}
>> +
>> +# get standard environment, filters and checks
>> +. ./common/rc
>> +. ./common/filter
>> +
>> +# real QA test starts here
>> +
>> +# Modify as appropriate.
>> +_supported_fs generic
>> +_supported_os Linux
>> +_require_test
>> +_require_runas
>
> Need a "_require_acls", and need to source common/attr first to use
> _require_acls.
>
>> +
>> +cd $TEST_DIR
>> +rm -f testfile
>
> I'd be better to name "testfile" with a test-specific prefix or suffix,
> e.g. testfile.$seq, so we can know it's from test $seq.
>
> I can fix these two nitpicks at commit time, if there's no new review
> comments from others.

Okay, thanks.

>> +
>> +touch testfile
>> +chown 100:100 testfile
>> +
>> +echo '*** SGID should remain set (twice)'
>> +chmod 2755 testfile
>> +_runas -u 100 -g 100 -- chmod 2777 testfile
>> +stat -c %A testfile
>> +chmod 2755 testfile
>> +_runas -u 100 -g 100 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
>> +stat -c %A testfile
>
> I noticed that NFSv4 cleared sgid bit on setfacl above, where the sgid
> bit should stay, maybe an NFS bug?

No, that's a setfacl bug:

http://git.savannah.gnu.org/cgit/acl.git/commit/?id=38f32ea1865bcc44185f4118fde469cb962cff68

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file
  2016-08-24  9:48   ` Andreas Gruenbacher
@ 2016-08-24  9:56     ` Eryu Guan
  0 siblings, 0 replies; 5+ messages in thread
From: Eryu Guan @ 2016-08-24  9:56 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: fstests, Jan Kara

On Wed, Aug 24, 2016 at 11:48:51AM +0200, Andreas Gruenbacher wrote:
> Eryu,
> 
> On Wed, Aug 24, 2016 at 11:28 AM, Eryu Guan <eguan@redhat.com> wrote:
> > On Tue, Aug 23, 2016 at 11:51:39PM +0200, Andreas Gruenbacher wrote:
> >> Check if SGID is cleared upon chmod / setfacl when the owner is not in
> >> the owning group.  As of today, the kernel fails to clear SGID in
> >> setxattr (which is what acl_set_file is implemented on top of) in that
> >> case; see this patch:
> >>   https://patchwork.kernel.org/patch/9290507/
> >>
> >> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> >> Cc: Jan Kara <jack@suse.cz>
> >> ---
> >>  tests/generic/375     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
> >>  tests/generic/375.out |  9 ++++++
> >>  tests/generic/group   |  1 +
> >>  3 files changed, 90 insertions(+)
> >>  create mode 100755 tests/generic/375
> >>  create mode 100644 tests/generic/375.out
> >>
> >> diff --git a/tests/generic/375 b/tests/generic/375
> >> new file mode 100755
> >> index 0000000..9976c3d
> >> --- /dev/null
> >> +++ b/tests/generic/375
> >> @@ -0,0 +1,80 @@
> >> +#! /bin/bash
> >> +# FS QA Test 375
> >> +#
> >> +# Check if SGID is cleared upon chmod / setfacl when the owner is not in the
> >> +# owning group.
> >> +#
> >> +#-----------------------------------------------------------------------
> >> +# Copyright (c) 2016 Red Hat.  All Rights Reserved.
> >> +#
> >> +# Author: Andreas gruenbacher <agruenba@redhat.com>
> >> +#
> >> +# This program is free software; you can redistribute it and/or
> >> +# modify it under the terms of the GNU General Public License as
> >> +# published by the Free Software Foundation.
> >> +#
> >> +# This program is distributed in the hope that it would be useful,
> >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >> +# GNU General Public License for more details.
> >> +#
> >> +# You should have received a copy of the GNU General Public License
> >> +# along with this program; if not, write the Free Software Foundation,
> >> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> >> +#-----------------------------------------------------------------------
> >> +#
> >> +
> >> +seq=`basename $0`
> >> +seqres=$RESULT_DIR/$seq
> >> +echo "QA output created by $seq"
> >> +
> >> +here=`pwd`
> >> +tmp=/tmp/$$
> >> +status=1     # failure is the default!
> >> +trap "_cleanup; exit \$status" 0 1 2 3 15
> >> +
> >> +_cleanup()
> >> +{
> >> +     cd /
> >> +     rm -f $tmp.*
> >> +}
> >> +
> >> +# get standard environment, filters and checks
> >> +. ./common/rc
> >> +. ./common/filter
> >> +
> >> +# real QA test starts here
> >> +
> >> +# Modify as appropriate.
> >> +_supported_fs generic
> >> +_supported_os Linux
> >> +_require_test
> >> +_require_runas
> >
> > Need a "_require_acls", and need to source common/attr first to use
> > _require_acls.
> >
> >> +
> >> +cd $TEST_DIR
> >> +rm -f testfile
> >
> > I'd be better to name "testfile" with a test-specific prefix or suffix,
> > e.g. testfile.$seq, so we can know it's from test $seq.
> >
> > I can fix these two nitpicks at commit time, if there's no new review
> > comments from others.
> 
> Okay, thanks.
> 
> >> +
> >> +touch testfile
> >> +chown 100:100 testfile
> >> +
> >> +echo '*** SGID should remain set (twice)'
> >> +chmod 2755 testfile
> >> +_runas -u 100 -g 100 -- chmod 2777 testfile
> >> +stat -c %A testfile
> >> +chmod 2755 testfile
> >> +_runas -u 100 -g 100 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
> >> +stat -c %A testfile
> >
> > I noticed that NFSv4 cleared sgid bit on setfacl above, where the sgid
> > bit should stay, maybe an NFS bug?
> 
> No, that's a setfacl bug:
> 
> http://git.savannah.gnu.org/cgit/acl.git/commit/?id=38f32ea1865bcc44185f4118fde469cb962cff68

Thanks for the info!

Eryu

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-24 10:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23 21:51 [PATCH] generic/375: Check clearing of SGID in chmod and acl_set_file Andreas Gruenbacher
2016-08-23 22:05 ` Andreas Gruenbacher
2016-08-24  9:28 ` Eryu Guan
2016-08-24  9:48   ` Andreas Gruenbacher
2016-08-24  9:56     ` Eryu Guan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.