namjaejeon / ksmbd-tools

ksmbd kernel server userspace utilities
GNU General Public License v2.0
52 stars 42 forks source link

"hosts allow" does not work? #191

Closed romanrm closed 1 year ago

romanrm commented 1 year ago

Hello,

In ksmbd-tools 3.4.5, with a config like this:

[test]
path = /mnt/p3/test/
hosts allow = 127.0.0.1 fd39::/64

Starting ksmbd leads to messages:

# ksmbd.mountd -n
[ksmbd-worker/5983]: INFO: Drop non-existing user `127.0.0.1'
[ksmbd-worker/5983]: INFO: Drop non-existing user `fd39::/64'

Same with "hosts deny".

I have not checked if the allow/deny behavior is actually enforced, the log messages suggest a config parse error.

Is it something fixed in a later version? I checked the commit history briefly, and did not notice anything similar.

romanrm commented 1 year ago

So "parse_list" is used for "hosts_list" https://github.com/namjaejeon/ksmbd-tools/blob/217d47d9a65f6ed82c3f1e671945d7e582a0bbe3/tools/management/share.c#L566 but that one does not have any special handling of hosts, and always expects and checks for users. https://github.com/namjaejeon/ksmbd-tools/blob/217d47d9a65f6ed82c3f1e671945d7e582a0bbe3/tools/management/share.c#L313

namjaejeon commented 1 year ago

It is not supported. See man ksmbd.conf. There is no this parameter in supported list.

romanrm commented 1 year ago

Thanks, in my version "man ksmbd.conf" was not shipped yet by Debian, so I viewed it in the source tree. And then was not familiar with the man syntax to see that it's commented out.

namjaejeon commented 1 year ago

Okay. If possible, please use the latest ksmbd-tool version:)