All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shyam Prasad N <nspmangalore@gmail.com>
To: "Steve French" <smfrench@gmail.com>,
	CIFS <linux-cifs@vger.kernel.org>,
	"Aurélien Aptel" <aaptel@suse.com>
Subject: Re: [PATCH 1/2] cifs: Fix unix perm bits to cifsacl conversion for "other" bits.
Date: Sun, 21 Feb 2021 07:26:36 -0800	[thread overview]
Message-ID: <CANT5p=o80ga62V9DGZ8CN=ETfB5_Ob8vjBYK6HuT8wm26HwSOA@mail.gmail.com> (raw)
In-Reply-To: <CANT5p=rHYSaYNiv4OUi_5vj4S_XH_vJmbVPFPAyTFBxvCgwGVw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]

Hi Steve,

It looks like the first patch I sent (above) was not the latest version.
I found it when testing one other cifsacl patch today.

Attached the fix for this bug.

Also attached xfstest for verifying that it works.
@Aurélien Aptel could you please review the test and add it to the
buildbot for cifsacl and modefromsid? When none of those two are used,
the test will fail.

Regards,
Shyam

On Mon, Nov 9, 2020 at 9:46 AM Shyam Prasad N <nspmangalore@gmail.com> wrote:
>
> Also attaching the sticky bit implementation.
> Have tested out some positive and negative test cases too. Works well,
> from what I can tell.
>
> Regards,
> Shyam
>
> On Mon, Nov 9, 2020 at 11:12 PM Shyam Prasad N <nspmangalore@gmail.com> wrote:
> >
> > Hi Steve,
> >
> > Here's the patch as per the discussion. I'm trying to maintain a
> > preferred order of ACEs as much as possible. I had to modify the
> > reverse conversion logic, since deny ACEs can appear in the middle of
> > the list now.
> >
> > Tested thoroughly with many permission modes, conversions and reverse
> > conversions.
> >
> > FYI, there's a sticky bit implementation which I've patched on top of
> > this fix. Will send that for review soon.
> >
> > --
> > -Shyam
>
>
>
> --
> -Shyam



-- 
Regards,
Shyam

[-- Attachment #2: 0001-cifs-Fix-cifsacl-ACE-mask-for-group-and-others.patch --]
[-- Type: application/octet-stream, Size: 918 bytes --]

From 91d547850f6ae304719f1847e724019cae6ec850 Mon Sep 17 00:00:00 2001
From: Shyam Prasad N <sprasad@microsoft.com>
Date: Sun, 21 Feb 2021 08:21:25 +0000
Subject: [PATCH] cifs: Fix cifsacl ACE mask for group and others.

A two line fix which I made while testing my prev fix with
cifsacl mode conversions seem to have gone missing in the final fix
that was submitted. This is that fix.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
 fs/cifs/cifsacl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index ff7fd0862e28..d9e704979d99 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -31,8 +31,8 @@
 #define EXEC_BIT        0x1
 
 #define ACL_OWNER_MASK 0700
-#define ACL_GROUP_MASK 0770
-#define ACL_EVERYONE_MASK 0777
+#define ACL_GROUP_MASK 0070
+#define ACL_EVERYONE_MASK 0007
 
 #define UBITSHIFT	6
 #define GBITSHIFT	3
-- 
2.25.1


[-- Attachment #3: 002-modecheck.out --]
[-- Type: application/octet-stream, Size: 103 bytes --]

QA output created by 002-modecheck
creating files...
sleeping for 20s...
checking modebits...
success!

[-- Attachment #4: 002-modecheck --]
[-- Type: application/octet-stream, Size: 1591 bytes --]

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2021 YOUR NAME HERE.  All Rights Reserved.
#
# FS QA Test 002-modecheck
#
# what am I here for?
#
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

# remove previous $seqres.full before test
rm -f $seqres.full

# real QA test starts here

# Modify as appropriate.
_supported_fs generic
_require_test

echo "creating files..."
i=0
mode=0
while [ $mode -lt 0777 ]; do
        filename=$(printf 'modecheck-file-0%o' $mode)
        touch $filename
        chmod $(printf '0%o' $mode) $filename
        # checking for all possible values is too time consuming
        # incrementing by 5 covers most values
        mode=$((mode+5))
        i=$((i+1))
done
total=$i

echo "sleeping for 20s..."
# actimeo has to be lesser than the sleep below
sleep 20

echo "checking modebits..."
i=0
for filename in $(ls modecheck-file-*); do
        exp_mode=$(($(echo $filename|sed 's/modecheck-file-//')))
        mode=$((8#$(stat --printf="%a\n" $filename)))
        if [ $mode -ne $exp_mode ]; then
                echo "Unexpected mode $mode for file $filename. Expected: $exp_mode"
                exit
        fi
        i=$((i+1))
done

if [ $i -ne $total ]; then
        echo "Unexpected number of files: $i. Expected: $total"
        exit
fi

echo "success!"

# success, all done
status=0
exit


      reply	other threads:[~2021-02-21 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 17:42 [PATCH 1/2] cifs: Fix unix perm bits to cifsacl conversion for "other" bits Shyam Prasad N
2020-11-09 17:46 ` Shyam Prasad N
2021-02-21 15:26   ` Shyam Prasad N [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANT5p=o80ga62V9DGZ8CN=ETfB5_Ob8vjBYK6HuT8wm26HwSOA@mail.gmail.com' \
    --to=nspmangalore@gmail.com \
    --cc=aaptel@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.