933 Commits

Author SHA1 Message Date
Ronnie Sahlberg f0ccf5f652 Try to read as much as possible from the socket in read_from_socket()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-07-31 13:13:41 +10:00
Ronnie Sahlberg dcddcd824e Immediately write PDUs to an idle socket
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-07-17 15:08:34 +10:00
Ronnie Sahlberg 2d0283eb0d Improve error string when create fails.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-07-17 13:51:12 +10:00
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 b878d4663d Fix rename issue against windows systems.
Some servers require additional padding in the rename operation
and will fail if this padding is missing.
Add 8 more bytes of padding to make them happy.

Fixes #420

Suggested-by: CNWangZW

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-07-12 08:53:18 +10:00
Harry Sintonen 60840f49ed fix syntax version encoding to process vers and vers_minor properly as two separate 16-bit numbers. the old code only worked correctly on little endian systems. 2025-06-16 04:01:58 +03:00
Harry Sintonen 833602d8c3 fix target info field offset for non-litle endian systems. 2025-06-15 01:22:50 +03:00
Ronnie Sahlberg e7e9334ea2 Merge pull request #414 from bdodge/bdd/make-sense-of-pdu-accessors
Bdd/make sense of pdu accessors
2025-06-07 19:32:03 +10:00
Pino Toscano b9bbf218fc Include <errno.h> before compat.h
compat.h defines fallback definitions for errno constants and it does
not include <errno.h> on its own; if <errno.h> is not already included
then there are wrongly generated fallback definitions.

Apply the approach already in other sources, i.e. explicitly include
<errno.h> before compat.h.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2025-06-03 07:24:12 +02:00
bdodge 5a439a485d Merge branch 'master' into bdd/make-sense-of-pdu-accessors 2025-05-30 07:46:59 -04:00
bdodge 7159bee359 add chained pdu accessor and name others properly 2025-04-29 07:23:06 -04:00
cy33hc 82d8bb6bbf smb2_echo fails if socket fd is valid 2025-04-19 16:53:47 -07:00
Wolf3s 414618539b [REFACTOR]: Add stdio.h in the top. 2025-04-18 12:35:31 -03:00
bdodge b3e7ddfdc3 fix length of utf conversion and dont use stack for it 2025-04-16 12:25:06 -04:00
Ronnie Sahlberg 7b06e1462c Check the return of asprintf in krb5-wrapper.c
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-04-02 12:27:35 +10:00
Ronnie Sahlberg 55555e27e3 Handle a bunch of other compiler warnings on armv6
and similararchectures that can not handle unaligned accesses
and where pointer conversions cause compiler warnings when converting
a pointer to a larger type.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-04-01 18:13:39 +10:00
Ronnie Sahlberg 66b0987872 Fix compiler warning about "cast increases required alignment"
Some ISA, like ARMv6, do not support unaligned memory accesses.
The cast here technically convert a the pointer target from a char to
another pointer.
However, as the buf field (char) is laid out after a pointer in the
structure definition, the alignment for buf is forced to the same
alignment as a pointer.
Thus the issue with unaligned access can not happen and the workaround
by re-casting the pointer via void * is safe.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2025-03-31 21:02:33 +10:00
Ronnie Sahlberg b1c254291c Merge pull request #403 from bdodge/bdd/use-hdr-msgi-if-no-pdu
Bdd/use hdr msgi if no pdu
2025-03-25 11:14:10 +10:00
bdodge 91247b3435 dont use signing-enabled bit on server side, must be ignored
dont care about signing bits at all

fail on signing not enabled on server
2025-03-22 19:00:12 -04:00
bdodge 6fd0a7072e fix flush request decode, allow new session in session
clarifications
2025-03-22 19:00:08 -04:00
Brad Smith 1e1cc90f53 Fix building on OpenBSD
OpenBSD does not have the ENOLINK errno.
2025-03-19 01:02:42 -04:00
Matthew Allen 9119f85fff Fix issue #404: smb2_timeval_to_win return type too small on 32bit systems. 2025-03-19 09:45:00 +11:00
bdodge 01ffcbba72 dont hack-set msgid, be explicit always 2025-03-13 11:58:35 -04:00
bdodge ba8b3ffb1b use smb2 hdr msgid if no pdu passed in 2025-03-12 11:54:59 -04:00
bdodge c8ed7765ad alloc for sizeof struct not wire size, even tough probably the same 2025-03-12 11:51:50 -04:00