openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.27k stars 2.51k forks source link

luci-app-ksmbd: Using Allowed Users and Enable Allowed Guest, Guest has Write Access #7244

Open CoiaPrant233 opened 1 month ago

CoiaPrant233 commented 1 month ago

Steps to reproduce:

  1. go to: Services → Network Shares
  2. Add a new share direct
  3. input Allowed Users and checked Allowed Guest
  4. Save & Apply
  5. Use SMB Client with guest access network share

Actual behavior:

Both logged in users and anonymous users have read and write permissions

Expected behavior:

Only logged in users have read and write permissions, anonymous users only have read permissions

Additional Information:

  1. Enable Force Root, Allowed User will not be used. See /etc/init.d/ksmbd
  2. Set read_only to 1 , write_list to 'Allowed Users' (valid users) to resolve.
CoiaPrant233 commented 1 month ago

Proposal:

  1. When there is only Enable Allowed Guest, the Guest has read and write permission
  2. If read-only is enabled, write list is not set

or

  1. When there is only Enable Allowed Guest, the Guest has read and write permission. (Code not needs to change)
  2. When there is only Using Allowed Users, the User has read and write permission. (Code not needs to change)
  3. Both of them. By setting read_only to 1 and write list to same 'valid users' (if not read-only)