diff --git a/Dockerfile b/Dockerfile index 12c8ae7..74dbf61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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} @@ -24,7 +26,7 @@ RUN apk --update --no-cache add \ bash \ coreutils \ jq \ - samba=${SAMBA_VERSION}-r0 \ + samba=${SAMBA_VERSION}-r1 \ shadow \ tzdata \ yq \ diff --git a/patches/wsdd2/0001-fix-msghdr-initialization.patch b/patches/wsdd2/0001-fix-msghdr-initialization.patch new file mode 100644 index 0000000..ca3d435 --- /dev/null +++ b/patches/wsdd2/0001-fix-msghdr-initialization.patch @@ -0,0 +1,31 @@ +From 0098d86d2998cff056ec19e734e17bf99d5314ae Mon Sep 17 00:00:00 2001 +From: CrazyMax <1951866+crazy-max@users.noreply.github.com> +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); +--