Skip to content

Commit

Permalink
Merge pull request #125 from crazy-max/update
Browse files Browse the repository at this point in the history
Samba 4.20.6
  • Loading branch information
crazy-max authored Dec 27, 2024
2 parents 1294ae5 + 89a87b3 commit 0f2b8b4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1

ARG ALPINE_VERSION=3.20
ARG ALPINE_VERSION=3.21
ARG S6_VERSION=2.2.0.3

ARG SAMBA_VERSION=4.19.9
ARG SAMBA_VERSION=4.20.6
ARG WSDD2_VERSION=b676d8ac8f1aef792cb0761fb68a0a589ded3207

FROM --platform=${BUILDPLATFORM} crazymax/alpine-s6:${ALPINE_VERSION}-${S6_VERSION} AS wsdd2-src
Expand All @@ -13,9 +13,11 @@ ADD "https://github.com/Netgear/wsdd2.git#${WSDD2_VERSION}" .

# TODO: do cross-compilation in this stage to build wsdd2
FROM crazymax/alpine-s6:${ALPINE_VERSION}-${S6_VERSION} AS wsdd2
RUN apk --update --no-cache add linux-headers gcc make musl-dev
RUN apk --update --no-cache add linux-headers gcc make musl-dev patch
WORKDIR /src
COPY --from=wsdd2-src /src /src
COPY patches/wsdd2 /tmp/wsdd2-patches
RUN patch -p1 < /tmp/wsdd2-patches/0001-fix-msghdr-initialization.patch
RUN make DESTDIR=/dist install

FROM crazymax/alpine-s6:${ALPINE_VERSION}-${S6_VERSION}
Expand All @@ -24,7 +26,7 @@ RUN apk --update --no-cache add \
bash \
coreutils \
jq \
samba=${SAMBA_VERSION}-r0 \
samba=${SAMBA_VERSION}-r1 \
shadow \
tzdata \
yq \
Expand Down
31 changes: 31 additions & 0 deletions patches/wsdd2/0001-fix-msghdr-initialization.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 0098d86d2998cff056ec19e734e17bf99d5314ae Mon Sep 17 00:00:00 2001
From: CrazyMax <[email protected]>
Date: Fri, 27 Dec 2024 15:40:27 +0100
Subject: [PATCH] fix msghdr initialization

---
wsdd2.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/wsdd2.c b/wsdd2.c
index 4f91f6e..1590561 100644
--- a/wsdd2.c
+++ b/wsdd2.c
@@ -543,7 +543,15 @@ static int netlink_recv(struct endpoint *ep)
char buf[PAGE_SIZE];
struct sockaddr_nl sa;
struct iovec iov = { buf, sizeof buf };
- struct msghdr msg = { &sa, sizeof sa, &iov, 1, NULL, 0, 0 };
+ struct msghdr msg;
+ memset(&msg, 0, sizeof(msg));
+ msg.msg_name = &sa;
+ msg.msg_namelen = sizeof(sa);
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = NULL;
+ msg.msg_controllen = 0;
+ msg.msg_flags = 0;
ssize_t msglen = recvmsg(ep->sock, &msg, 0);

DEBUG(2, W, "%s: %zd bytes", __func__, msglen);
--

0 comments on commit 0f2b8b4

Please sign in to comment.