Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Ralph Boehme <slow@samba.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Hobin Woo <hobin.woo@samsung.com>,
	linux-cifs@vger.kernel.org, sfrench@samba.org,
	senozhatsky@chromium.org, tom@talpey.com, sj1557.seo@samsung.com,
	yoonho.shin@samsung.com, kiras.lee@samsung.com
Subject: Re: [PATCH v2] ksmb: discard write access to the directory open
Date: Fri, 5 Jul 2024 15:16:52 +0200	[thread overview]
Message-ID: <ef50bdc4-360f-4714-a503-bddbdabcbb14@samba.org> (raw)
In-Reply-To: <CAKYAXd_6pHALjKQQDf4xOGoReZ9jBw-KtFBEh7uV8+aw3VNKZw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1443 bytes --]

On 7/5/24 2:33 PM, Namjae Jeon wrote:
> 2024년 7월 5일 (금) 오후 8:54, Ralph Boehme <slow@samba.org>님이 작성:
>>
>> On 7/5/24 5:27 AM, Hobin Woo wrote:
>>> may_open() does not allow a directory to be opened with the write access.
>>> However, some writing flags set by client result in adding write access
>>> on server, making ksmbd incompatible with FUSE file system. Simply, let's
>>> discard the write access when opening a directory.
>>
>> afair this should cause a failure like EACCESS or EISDIR and just be
>> ignored. What does a Windows server return in this case, or Samba for
>> that matter as it (hopefully) will behave like Windows.
>  From what I've checked the packet dump, Samba doesn't return any
> errors in the same case.
> Samba seems to open it with O_RDONLY if it is directory, So there is
> no problem, is it right?

Hm, it seems my memory is playing tricks on me. Samba indeed forces 
O_RDONLY for directories in the servers and ignores the client requested 
access mask. Interestingly we don't seem to have any test for this case, 
at least I couldn't find any with a quick search. Quickly putting 
together a torture test shows Windows behaves the same. MS-FSA doesn't 
mention any such check should be done for directories as well. Getinfo 
on such a handle even returns the original unmodified client access 
mask, including the write access.

Sorry for the noise! :)

-slow

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2024-07-05 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240705032731epcas1p177d910a154ded37c459af1c2374a3571@epcas1p1.samsung.com>
2024-07-05  3:27 ` [PATCH v2] ksmb: discard write access to the directory open Hobin Woo
2024-07-05 11:39   ` Namjae Jeon
2024-07-05 14:57     ` Steve French
2024-07-05 11:53   ` Ralph Boehme
2024-07-05 12:33     ` Namjae Jeon
2024-07-05 13:16       ` Ralph Boehme [this message]
2024-07-05 13:51         ` Tom Talpey
2024-07-08 12:31           ` Hobin Woo

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=ef50bdc4-360f-4714-a503-bddbdabcbb14@samba.org \
    --to=slow@samba.org \
    --cc=hobin.woo@samsung.com \
    --cc=kiras.lee@samsung.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=sfrench@samba.org \
    --cc=sj1557.seo@samsung.com \
    --cc=tom@talpey.com \
    --cc=yoonho.shin@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox