Bug 15285 - libsmbclient NT_STATUS_LOGON_FAILURE on DFS share
Summary: libsmbclient NT_STATUS_LOGON_FAILURE on DFS share
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.15.9
Hardware: x64 Linux
: P5 major (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-12 10:43 UTC by Sam Lin
Modified: 2023-01-12 10:48 UTC (History)
0 users

See Also:


Attachments
Debug output from libsmbclient (40.13 KB, text/plain)
2023-01-12 10:43 UTC, Sam Lin
no flags Details
tcpdump from the NT_STATUS_LOGON_FAILURE program (11.32 KB, application/vnd.tcpdump.pcap)
2023-01-12 10:44 UTC, Sam Lin
no flags Details
tcpdump from the NT_STATUS_LOGON_FAILURE program (ignore the previous one)) (8.72 KB, application/vnd.tcpdump.pcap)
2023-01-12 10:47 UTC, Sam Lin
no flags Details
tcpdump from the fixed program (59.42 KB, application/vnd.tcpdump.pcap)
2023-01-12 10:48 UTC, Sam Lin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Lin 2023-01-12 10:43:01 UTC
Created attachment 17729 [details]
Debug output from libsmbclient

I wrote something like this:

SMBCCTX *smbcctx = smbc_new_context();
SmbcAuth smbc_auth;smbc_auth.address = "fs.rookad.local";  
smbc_auth.user = "rookad/administrator";            
smbc_auth.password = mypassword;  
smbc_auth.workgroup = "";    
smbc_setOptionUserData(smbcctx, &smbc_auth);
smbc_setFunctionAuthDataWithContext(smbcctx, smbc_auth_fn_ctx);
smbc_init_context(smbcctx);

SMBCFILE *smbfile = NULL;
string smbpath = "smb://" + smbc_auth.address + "/home/sam";
if (NULL == (smbfile = smbc_getFunctionOpendir(smbcctx)(smbcctx,
                                                        smbpath.c_str()))) {
    perror("smbc_getFunctionOpendir");
    return 1;
}

But got the output:

session setup failed: NT_STATUS_LOGON_FAILURE
Could not resolve \sam\*
smbc_getFunctionOpendir: No such file or directory

In the wireshark file attached, from the packet, I can see the username passed in is a bit strange: User = WORKGROUP\rookad/administrator, it should be User = ROOKAD\administrator.

If I change the code above to the following, it works normally:
smbc_auth.user = "administrator";
smbc_auth.workgroup = "rookad";

And the wireshark file is attached.
Comment 1 Sam Lin 2023-01-12 10:44:51 UTC
Created attachment 17730 [details]
tcpdump from the NT_STATUS_LOGON_FAILURE program
Comment 2 Sam Lin 2023-01-12 10:47:07 UTC
Created attachment 17731 [details]
tcpdump from the NT_STATUS_LOGON_FAILURE program (ignore the previous one))
Comment 3 Sam Lin 2023-01-12 10:48:44 UTC
Created attachment 17732 [details]
tcpdump from the fixed program