wa2c / cifs-documents-provider

CIFS Documents Provider
MIT License
295 stars 26 forks source link

Cannot access share that uses a user with name and password guest #86

Open topas-rec opened 2 months ago

topas-rec commented 2 months ago

Describe the bug

Connecting to a shared folder that is shared with authentication and has a user name guestand password guest results in an empty folder with the hint to sign in through CIFS provider. The credentials are of course set up correctly.

Changing the authentication user name and password in the share solves the problem and the folder can be accessed.

Linux and Windows 10 can access the share without problem.

Tested with a share made from Linux and Windows 10. To Reproduce

  1. Create a share with authentication and user name guest and password guest
  2. Enter credentials and host in CIFS provider
  3. Try to o open a shared folder of that host
  4. See an empty folder with hint to sign in to this share

Expected behavior The share is accessible.

Screenshots

CIFS Documents Provider

App installed device (please complete the following information):

Server (please complete the following information):

Additional context

Can someone please try to reproduce this?

YanceyChiew commented 2 months ago

This is because in cifs-documents-provider, once the username is left blank or set to 'guest', the guest credentials are used directly without trial and fallback processing.

A further reason is that cifs is a file sharing mechanism on Windows, and ‘guest’ is the default guest username on Windows. When this user is enabled, you can log in with any password.

It is theoretically possible to use 'guest' as a normal username, but there seems to be no strong enough reason to be compatible with this situation, especially since the current situation itself is caused by the behavior of compatiting guest users.

By the way, in the default behavior of the jcifs-ng library, once the username is set to guest, it will automatically replace it with GUEST.