From cd5dc6c5a6a9ff55c3418495b7a937fff0c8479d Mon Sep 17 00:00:00 2001 From: Wolfywolfy Date: Sat, 12 Oct 2024 07:53:16 -0300 Subject: [PATCH] Fix build on amiga os. --- lib/Makefile.AMIGA | 2 +- lib/compat.h | 1 + lib/libsmb2.c | 1 + lib/smb2-cmd-ioctl.c | 5 ++--- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Makefile.AMIGA b/lib/Makefile.AMIGA index db1ed14e..f041d527 100644 --- a/lib/Makefile.AMIGA +++ b/lib/Makefile.AMIGA @@ -7,7 +7,7 @@ OPTIMIZE = -O2 DEBUG = -gstabs WARNINGS = -Wall -Werror -Wwrite-strings INCLUDES = -I. -I../include -I../include/smb2 -I../include/amiga_os -DEFINES = -DHAVE_CONFIG_H "-D_U_=__attribute__((unused))" -DNEED_POLL -DNEED_GETADDRINFO -DNEED_FREEADDRINFO -DNEED_GETLOGIN_R -DHAVE_LINGER +DEFINES = -DHAVE_CONFIG_H "-D_U_=__attribute__((unused))" -DHAVE_ADDRINFO -DNEED_POLL -DNEED_GETADDRINFO -DNEED_FREEADDRINFO -DNEED_GETLOGIN_R -DHAVE_LINGER CFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS) $(INCLUDES) $(DEFINES) diff --git a/lib/compat.h b/lib/compat.h index 7259a7a5..dd9b8d90 100644 --- a/lib/compat.h +++ b/lib/compat.h @@ -362,6 +362,7 @@ struct addrinfo { struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */ }; + #endif int poll(struct pollfd *fds, unsigned int nfds, int timo); diff --git a/lib/libsmb2.c b/lib/libsmb2.c index 29bfff35..d3ec4156 100644 --- a/lib/libsmb2.c +++ b/lib/libsmb2.c @@ -3403,6 +3403,7 @@ smb2_negotiate_request_cb(struct smb2_context *smb2, int status, void *command_d struct smb2_pdu *pdu; uint16_t dialects[SMB2_NEGOTIATE_MAX_DIALECTS]; int dialect_count; + int d; int dialect_index; struct smb2_timeval now; /*void *auth_data;*/ diff --git a/lib/smb2-cmd-ioctl.c b/lib/smb2-cmd-ioctl.c index 83fb1c71..7a3fd9fa 100644 --- a/lib/smb2-cmd-ioctl.c +++ b/lib/smb2-cmd-ioctl.c @@ -393,11 +393,10 @@ smb2_process_ioctl_request_variable(struct smb2_context *smb2, switch (req->ctl_code) { case SMB2_FSCTL_VALIDATE_NEGOTIATE_INFO: - { - struct smb2_ioctl_validate_negotiate_info *info; + /* this one is handled locally regardless of proxy or not */ ptr = smb2_alloc_init(smb2, sizeof(struct smb2_ioctl_validate_negotiate_info)); - info = ptr; + struct smb2_ioctl_validate_negotiate_info *info = ptr; smb2_get_uint32(&vec, 0, &info->capabilities); memcpy(info->guid, &vec.buf[4], 16);