Bug 1475415 - Smbclient throws NT_STATUS_UNSUCCESSFUL first time it is called
Smbclient throws NT_STATUS_UNSUCCESSFUL first time it is called
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: samba (Show other bugs)
7.3
Unspecified Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Andreas Schneider
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-26 11:31 EDT by Andrej Dzilský
Modified: 2017-08-16 03:22 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-16 03:22:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrej Dzilský 2017-07-26 11:31:34 EDT
Description of problem:

First time when smbclient is called, it throws: NT_STATUS_UNSUCCESSFUL
 

Version-Release number of selected component (if applicable):

I've tested it on RHEL 6.9, 7.2, 7.3 and 7.4 and it is reproducible for me only on 7.2 and 7.3 

RHEL7.2 packages:
samba-client-4.2.3-10.el7.x86_64
samba-common-4.2.3-10.el7.noarch
samba-winbind-modules-4.2.3-10.el7.x86_64
samba-winbind-clients-4.2.3-10.el7.x86_64
samba-CoreOS-samba-Library-samba-bits-2.0-18.noarch
samba-common-tools-4.2.3-10.el7.x86_64
samba-common-libs-4.2.3-10.el7.x86_64
samba-winbind-4.2.3-10.el7.x86_64
samba-4.2.3-10.el7.x86_64
samba-libs-4.2.3-10.el7.x86_64
samba-client-libs-4.2.3-10.el7.x86_64


RHEL7.3 packages:
samba-libs-4.4.4-15.el7_3.x86_64
samba-4.4.4-15.el7_3.x86_64
samba-test-libs-4.4.4-15.el7_3.x86_64
samba-python-4.4.4-15.el7_3.x86_64
samba-pidl-4.4.4-15.el7_3.noarch
samba-vfs-glusterfs-4.4.4-15.el7_3.x86_64
samba-debuginfo-4.4.4-15.el7_3.x86_64
samba-common-libs-4.4.4-15.el7_3.x86_64
samba-common-tools-4.4.4-15.el7_3.x86_64
samba-dc-libs-4.4.4-15.el7_3.x86_64
samba-winbind-4.4.4-15.el7_3.x86_64
samba-client-4.4.4-15.el7_3.x86_64
samba-dc-4.4.4-15.el7_3.x86_64
samba-krb5-printing-4.4.4-15.el7_3.x86_64
samba-test-4.4.4-15.el7_3.x86_64
samba-winbind-krb5-locator-4.4.4-15.el7_3.x86_64
samba-client-libs-4.4.4-15.el7_3.x86_64
samba-winbind-modules-4.4.4-15.el7_3.x86_64
samba-winbind-clients-4.4.4-15.el7_3.x86_64
samba-devel-4.4.4-15.el7_3.x86_64
samba-CoreOS-samba-Library-samba-bits-2.0-18.noarch
samba-common-4.4.4-15.el7_3.noarch

Steps to Reproduce:

1. Have configured samba, if it's joined to AD or not, it doesn't matter

:: [  BEGIN   ] :: Running 'testparm -s'
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[testshare]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
	server string = Samba Server Version %v
	workgroup = MYGROUP
	server signing = if_required
	winbind request timeout = 120
	idmap config * : backend = tdb


[homes]
	comment = Home Directories
	browseable = No
	read only = No


[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = No
	printable = Yes


[testshare]
	path = /tmp/tmp.Es2afcxa9P
	follow symlinks = No
	read only = No
	valid users = testuser

2. Call smbclient for example twice in a row

:: [  BEGIN   ] :: Running 'smbclient -d4 //127.0.0.1/ -L localhost -U testuser%testuser'
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
doing parameter winbind request timeout = 120
doing parameter workgroup = MYGROUP
doing parameter server string = Samba Server Version %v
doing parameter server signing = auto
pm_process() returned Yes
added interface eth0 ip=10.8.174.10 bcast=10.8.174.10 netmask=255.255.255.255
added interface eth0 ip=172.16.36.229 bcast=172.16.36.255 netmask=255.255.255.0
Client started (version 4.4.4).
resolve_lmhosts: Attempting lmhosts lookup for name localhost<0x20>
getlmhostsent: lmhost entry: 127.0.0.1 localhost 
Connecting to 127.0.0.1 at port 445
 session request ok
Doing spnego session setup (blob length=74)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=not_defined_in_RFC4178@please_ignore
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'spnego' registered
GENSEC backend 'schannel' registered
GENSEC backend 'naclrpc_as_system' registered
GENSEC backend 'sasl-EXTERNAL' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'ntlmssp_resume_ccache' registered
GENSEC backend 'http_basic' registered
GENSEC backend 'http_ntlm' registered
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_TARGET_TYPE_SERVER
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_TARGET_INFO
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
SPNEGO login failed: Undetermined error
session setup failed: NT_STATUS_UNSUCCESSFUL
:: [   FAIL   ] :: Command 'smbclient -d4 //127.0.0.1/ -L localhost -U testuser%testuser' (Expected 0, got 1)



:: [  BEGIN   ] :: Running 'smbclient -d4 //127.0.0.1/ -L localhost -U testuser%testuser'
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
doing parameter winbind request timeout = 120
doing parameter workgroup = MYGROUP
doing parameter server string = Samba Server Version %v
doing parameter server signing = auto
pm_process() returned Yes
added interface eth0 ip=10.8.174.10 bcast=10.8.174.10 netmask=255.255.255.255
added interface eth0 ip=172.16.36.229 bcast=172.16.36.255 netmask=255.255.255.0
Client started (version 4.4.4).
Connecting to 127.0.0.1 at port 445
 session request ok
Doing spnego session setup (blob length=74)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=not_defined_in_RFC4178@please_ignore
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'spnego' registered
GENSEC backend 'schannel' registered
GENSEC backend 'naclrpc_as_system' registered
GENSEC backend 'sasl-EXTERNAL' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'ntlmssp_resume_ccache' registered
GENSEC backend 'http_basic' registered
GENSEC backend 'http_ntlm' registered
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_TARGET_TYPE_SERVER
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_TARGET_INFO
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
Domain=[MYGROUP] OS=[Windows 6.1] Server=[Samba 4.4.4]
 session setup ok
 tconx ok

	Sharename       Type      Comment
	---------       ----      -------
	testshare       Disk      
	IPC$            IPC       IPC Service (Samba Server Version 4.4.4)
	testuser        Disk      Home Directories
Connecting to 127.0.0.1 at port 139
 session request ok
Doing spnego session setup (blob length=74)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=not_defined_in_RFC4178@please_ignore
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_TARGET_TYPE_SERVER
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_TARGET_INFO
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62088215
  NTLMSSP_NEGOTIATE_UNICODE
  NTLMSSP_REQUEST_TARGET
  NTLMSSP_NEGOTIATE_SIGN
  NTLMSSP_NEGOTIATE_NTLM
  NTLMSSP_NEGOTIATE_ALWAYS_SIGN
  NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
  NTLMSSP_NEGOTIATE_VERSION
  NTLMSSP_NEGOTIATE_128
  NTLMSSP_NEGOTIATE_KEY_EXCH
Domain=[MYGROUP] OS=[Windows 6.1] Server=[Samba 4.4.4]
 session setup ok
 tconx ok

	Server               Comment
	---------            -------
	QEOS-12              Samba Server Version 4.2.3
	QEOS-229             Samba Server Version 4.4.4

	Workgroup            Master
	---------            -------
	MYGROUP              QEOS-229
:: [   PASS   ] :: Command 'smbclient -d4 //127.0.0.1/ -L localhost -U testuser%testuser' (Expected 0, got 0)


Additional info:
Comment 2 Andrej Dzilský 2017-07-27 05:59:53 EDT
Something is propably with winbind, when I turn off winbind service on STANDA_ALONE samba server then smbclient works fine every time.
Comment 3 Andreas Schneider 2017-07-27 12:48:03 EDT
Then check the winbind logs :)
Comment 6 Andreas Schneider 2017-08-14 11:43:35 EDT
Andrej, does this work with RHEL 7.4 (Samba 4.6)?
Comment 7 Andrej Dzilský 2017-08-15 04:42:59 EDT
Yes, it worked and works with Samba 4.6. The thing is I can't reproduce it anymore ... :) ... even on RHEL 7.2/7.3 ... Maybe I've been just doing something bad. I have no clue why it doesn't worked like few weeks ago.

Note You need to log in before you can comment on or make changes to this bug.