nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
107 stars 64 forks source link

public const SMBCLIENT breaks on FreeBSD and other BSDs #215

Open mmattausch opened 1 year ago

mmattausch commented 1 year ago

Steps to reproduce

  1. Roll out Nextcloud 22++
  2. install user_external and configure for smb auth
  3. try to login

Expected behaviour

Tell us what should happen User should be authenticated agains smb

Actual behaviour

Tell us what happens instead

No auth happens -

[user_external] Fehler: ERROR: smbclient executable missing

POST /login from 80.147.75.68 at 2023-01-10T15:39:18+00:00

Affected Authentication backend

SMB

Server configuration

User External App version: all recent

Operating system: BSDs (FreeBSD, TrueNAS ...)

Web server:

Database:

PHP version:

Nextcloud version: (see Nextcloud admin page)

22++

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

If I fix the hardcoded SMBCLIENT - it works: (this patch works for the last few versions - it used to work in early versions without patch) The smbclient binary is found when you type "smbclient" on any shell - and "wicht smbclient" throws the correct path


+++ /usr/local/www/nextcloud/apps/user_external/lib/SMB.php     2023-01-10 16:34:26.196171845 +0100
@@ -19,7 +19,7 @@
 class SMB extends Base {
        private $host;

-       public const SMBCLIENT = '/usr/local/bin/smbclient -L';
+       public const SMBCLIENT = 'smbclient -L';
        public const LOGINERROR = 'NT_STATUS_LOGON_FAILURE';