136 Commits

Author SHA1 Message Date
Ronnie Sahlberg 5e2bf72df6 Improve parsing of NTLM_USER_FILE
Try to match the first field of this file as either the smb2
domain OR the server name.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-07-17 13:30:23 +10:00
Ronnie Sahlberg 66403a8434 ntlmssp: update ntlmssp domain/password after parsing the challenge message
In the challenge message we might learn a new domain name to use to talk
to the server. In that case matching password in the NTLM_USER_FILE
might change so we need to update auth_data with the new domain/password
before we generate the ntlmssp auth message.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-01-05 19:55:31 +10:00
Ronnie Sahlberg 78ae960438 Always provide smb2_set_password_from_file()
but disable the body of the function on platforms where
we do not hae a filesystem.
This also removes the need to check platform before
calling this function.

This fixes ps2 build.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-01-03 09:55:15 +10:00
Ronnie Sahlberg ee47fcc647 ntlmssp: match domain when parsing NTLM_USER_FILE for passwords
If we know the domain, match both domain and username when
scanning NTLM_USER_FILE for the password to use.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-12-28 14:57:18 +10:00
Ronnie Sahlberg 1899df36a7 Add extra NULL checks in smb2_set_[domain|workstation]
From bdodge <bdodge09@gmail.com>

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-12-28 09:02:11 +10:00
Ronnie Sahlberg b58f4bdcb5 Add smb2_get_workstation
From bdodge <bdodge09@gmail.com>
Add getter to read the workstation from the smb2 context

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-12-28 08:35:30 +10:00
briandodge 2a5e83ae4b add krb5 cred handle passing and release mechanism for proxying 2024-12-21 15:53:55 +10:00
Ronnie Sahlberg 5518394f90 fix segv in smb2_set_password_from_file if smb2->user==NULL
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-12-20 06:18:43 +10:00
Ronnie Sahlberg 6a161d055b opendir: don't dereference cb_data when in shutdown mode
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-12-18 16:15:16 +10:00
Ronnie Sahlberg e77fa802a1 Merge branch 'master' into bdd/oplock 2024-10-23 02:27:08 -04:00
Ronnie Sahlberg 5a0ad8a06b destroy_context: reorder how we cancel/free pdus at context destruction
to ensure that we invoke the callbacks in the correct order for
compound pdus

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-10-07 10:31:21 +10:00
Ronnie Sahlberg 5304e6705b cb_data: make the initial cb_data an embedded struct
in smb2_context.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-10-07 08:06:49 +10:00
Ronnie Sahlberg 9918577312 libsmb2: fix cb_data leak when session fails during early connect
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2024-10-07 07:23:39 +10:00
bdodge 77125da0aa functional oplock and lease breaks 2024-10-04 16:59:44 -04:00
bdodge b98e49720a working oplock and lease break processing 2024-10-04 14:19:00 -04:00
bdodge 7a4dc8f7bb proper handling of tree and message id and credits for server-side impl, provide accessors so a proxy and set hdr of new pdu based on old one 2024-09-29 17:55:59 -04:00
bdodge 0f3d7cacf2 use passthrough to marshall raw blobs 2024-09-25 19:19:56 -04:00
bdodge f696380d46 typo 2024-09-25 18:48:07 -04:00
bdodge 88813cf8c3 add function to see if a context is listed 2024-09-25 18:43:23 -04:00
bdodge f43bb10cfc clean up seterror/printfs, add cb for errors, add accessor for dialect 2024-09-24 13:08:13 -04:00
bdodge 7757e3e6be per client auth context, authorize handler for server plugin 2024-09-23 14:04:25 -04:00
bdodge 1d201b94b6 spnego unwrapping 2024-09-22 12:46:41 -04:00
bdodge 9684c391c2 working server to session respone, need to process secblob 2024-09-13 20:43:13 -04:00
bdodge d820207eb8 detab 2024-09-12 10:43:18 -04:00
bdodge 7120652bd6 implement server side, netprot works basically 2024-09-12 10:39:32 -04:00