From nobody Wed Jun 11 11:16:19 2025 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHNQD0Zzpz5xgLw; Wed, 11 Jun 2025 11:16:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHNQC6v3dz4Fx8; Wed, 11 Jun 2025 11:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749640580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pco0ccEa6/4UJqqFtaS+oaDMYNQpQiqAlMDRwOt7ME=; b=bOnIwZgSVUntLZi9cDmjXn4WY0Z5JHmzP5ZeJasTsrxIQd5oVq31ofo/7mamasztLpMyHD U1SZC1lR6Sg3PRVgaBIm8xA6wX7kvNLzUMmc3i0MGmtAak4A/qgcbhvNCDU3/w7XvsFV0G 6Lx9JnlfQO8c5CsfSp7vQg98TkE05pFeqXHFx7YvSjiHlbpvNjhEMC+uNS2sxbjHuZ3l6t hfhwoLcX52Ds9Igx9PvlxVMTtmV0+QyscfaCu+jPsAvid09UQ9iS94ESSbRn2yYasAy7rE +Mxs9TSIaaJSWWhwfBtjGuxQOFVldULrn7wm2XJWI4Q8eEh2zs8XMQAhiRCzoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749640580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pco0ccEa6/4UJqqFtaS+oaDMYNQpQiqAlMDRwOt7ME=; b=ovCOE8EbbSGyMf2PpSxRgjWZLGZS675XbmALo45a500L/GZNnOy74XfOcmgotn0Nkj06YA n0ewYRP+FosL/+FR/zZVQNsWYnCp+OTKLHuZaIgvHaY1ngsDT3EEoGkDZWTYiQvWq4s93Z UYS4qFxAbvxpvN6mdeXURZ+vaUfZI2J8kywgV9TRSCOBmBzWgHIS68NHKF9pXtG65HAjVB PJeLugpQHcy54JlEreYwl5h8glPQF9dcWe3nR/k0BLc6cx+HMlz45ttol7ppruBAwJEcSS T/DqYK+aPWYPkeXCAqZfQLd7PTE/pAM5opv3uEh5H/PgqoQE2Uz0Grp+OJVARw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749640580; a=rsa-sha256; cv=none; b=tGigFygmg2nAucF7VfJEc1XWdwujAzNVv7eUieRx2g3ikUdbbxq3oPhzrM1/S7xUDePe7c nR51cSgGAT3Y6xtv3n841+136xyOM7A7B1LxbqIr18LYEfWjStHeCtIJb4Yw6swTM2cMdg kUQwvu9oeYHXeX89Qm43LAadorPYDRmolluL5U/NiNHGmIhfqhHp8uQK0209yvVTlcjlAl Jobd5FYfHgscmbf1iCPvLWSlZnel67dtWc8L3m67VwdvVYXnNJWLdLqf/mD7BWG9tUF5Xc uzDPv8tpkOlBkOORcEBLwtvoCKVH6MMORsrgXNghyWDTKZM5w/qdkpxWt7s5/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHNQC67ldz8P4; Wed, 11 Jun 2025 11:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BBGJ3L091493; Wed, 11 Jun 2025 11:16:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BBGJMo091490; Wed, 11 Jun 2025 11:16:19 GMT (envelope-from git) Date: Wed, 11 Jun 2025 11:16:19 GMT Message-Id: <202506111116.55BBGJMo091490@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Xavier Beaudouin Subject: git: 22ffc318738f - main - net/samba420: Unbreak samba 4.20 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kiwi X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22ffc318738f779c5f36fb050553040f737bc9b3 Auto-Submitted: auto-generated The branch main has been updated by kiwi: URL: https://cgit.FreeBSD.org/ports/commit/?id=22ffc318738f779c5f36fb050553040f737bc9b3 commit 22ffc318738f779c5f36fb050553040f737bc9b3 Author: ml@netfence.it AuthorDate: 2025-06-10 14:03:27 +0000 Commit: Xavier Beaudouin CommitDate: 2025-06-11 11:15:46 +0000 net/samba420: Unbreak samba 4.20 This fix the 0100 patch to make file creation working. The patch has been updated to not alter too much the patch, to make it working. This make now samba 4.20 working even if it has only be tested on Windows and MacOS with basic functionality. PR: 284623 Approved by: 0mp (mentor) Approved by: samba (kiwi) Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50778 --- net/samba420/Makefile | 2 +- ...href-handling-for-FreeBSD-13plus_samba42x.patch | 93 ++++++++++++---------- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/net/samba420/Makefile b/net/samba420/Makefile index 4b0c0fa314c4..182c270f5a29 100644 --- a/net/samba420/Makefile +++ b/net/samba420/Makefile @@ -1,6 +1,6 @@ PORTNAME= ${SAMBA4_BASENAME}420 PORTVERSION= ${SAMBA4_VERSION} -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES?= net MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc DISTNAME= ${SAMBA4_DISTNAME} diff --git a/net/samba420/files/0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch b/net/samba420/files/0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch index 3e2a44d1acab..3a185fe80175 100644 --- a/net/samba420/files/0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch +++ b/net/samba420/files/0100-Fix-pathref-handling-for-FreeBSD-13plus_samba42x.patch @@ -421,19 +421,27 @@ diff -Naurp a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c diff -Naurp a/source3/smbd/open.c b/source3/smbd/open.c --- a/source3/smbd/open.c 2024-08-02 07:54:09.637892500 -0400 +++ b/source3/smbd/open.c 2024-08-05 21:27:26.052148000 -0400 -@@ -1165,47 +1165,52 @@ static NTSTATUS reopen_from_fsp(struct files_struct *d +@@ -1169,51 +1169,54 @@ static NTSTATUS reopen_from_fsp(struct files_struct *d + const struct vfs_open_how *how, bool *p_file_created) { - NTSTATUS status; -+ int new_fd; - int old_fd; +- NTSTATUS status; +- int old_fd; ++ NTSTATUS status; ++ int old_fd; - if (fsp->fsp_flags.have_proc_fds && - ((old_fd = fsp_get_pathref_fd(fsp)) != -1)) { -+ old_fd = fsp_get_pathref_fd(fsp); -+ if (old_fd == -1) { -+ return NT_STATUS_MORE_PROCESSING_REQUIRED; -+ } ++ old_fd = fsp_get_pathref_fd(fsp); ++ if (old_fd == -1) { ++ int new_fd; ++ if (sys_open_real_fd_from_pathref_fd(old_fd, &new_fd, how->flags) != 0) { ++ if (fsp->fsp_flags.have_proc_fds) { ++ struct sys_proc_fd_path_buf buf; ++ struct smb_filename proc_fname = (struct smb_filename){ ++ .base_name = sys_proc_fd_path(old_fd, &buf), ++ }; ++ mode_t mode = fsp->fsp_name->st.st_ex_mode; - struct sys_proc_fd_path_buf buf; - struct smb_filename proc_fname = (struct smb_filename){ @@ -441,16 +449,15 @@ diff -Naurp a/source3/smbd/open.c b/source3/smbd/open.c - }; - mode_t mode = fsp->fsp_name->st.st_ex_mode; - int new_fd; -+ if (sys_open_real_fd_from_pathref_fd(old_fd, &new_fd, how->flags) != 0) { -+ if (fsp->fsp_flags.have_proc_fds) { -+ struct sys_proc_fd_path_buf buf; -+ struct smb_filename proc_fname = (struct smb_filename){ -+ .base_name = sys_proc_fd_path(old_fd, &buf), -+ }; -+ mode_t mode = fsp->fsp_name->st.st_ex_mode; ++ SMB_ASSERT(fsp->fsp_flags.is_pathref); - SMB_ASSERT(fsp->fsp_flags.is_pathref); -+ SMB_ASSERT(fsp->fsp_flags.is_pathref); ++ if (S_ISLNK(mode)) { ++ return NT_STATUS_STOPPED_ON_SYMLINK; ++ } ++ if (!(S_ISREG(mode) || S_ISDIR(mode))) { ++ return NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED; ++ } - if (S_ISLNK(mode)) { - return NT_STATUS_STOPPED_ON_SYMLINK; @@ -458,24 +465,22 @@ diff -Naurp a/source3/smbd/open.c b/source3/smbd/open.c - if (!(S_ISREG(mode) || S_ISDIR(mode))) { - return NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED; - } -+ if (S_ISLNK(mode)) { -+ return NT_STATUS_STOPPED_ON_SYMLINK; -+ } -+ if (!(S_ISREG(mode) || S_ISDIR(mode))) { -+ return NT_STATUS_IO_REPARSE_TAG_NOT_HANDLED; -+ } ++ new_fd = SMB_VFS_OPENAT(fsp->conn, ++ fsp->conn->cwd_fsp, ++ &proc_fname, ++ fsp, ++ how); ++ if (new_fd == -1) { ++ status = map_nt_error_from_unix(errno); ++ fd_close(fsp); ++ return status; ++ } - fsp->fsp_flags.is_pathref = false; -+ new_fd = SMB_VFS_OPENAT(fsp->conn, -+ fsp->conn->cwd_fsp, -+ &proc_fname, -+ fsp, -+ how); -+ if (new_fd == -1) { -+ status = map_nt_error_from_unix(errno); -+ fd_close(fsp); -+ return status; -+ } ++ status = fd_close(fsp); ++ if (!NT_STATUS_IS_OK(status)) { ++ return status; ++ } - new_fd = SMB_VFS_OPENAT(fsp->conn, - fsp->conn->cwd_fsp, @@ -487,22 +492,24 @@ diff -Naurp a/source3/smbd/open.c b/source3/smbd/open.c - fd_close(fsp); - return status; - } -+ status = fd_close(fsp); -+ if (!NT_STATUS_IS_OK(status)) { -+ return status; -+ } ++ fsp_set_fd(fsp, new_fd); ++ fsp->fsp_flags.is_pathref = false; - status = fd_close(fsp); - if (!NT_STATUS_IS_OK(status)) { - return status; - } -+ fsp_set_fd(fsp, new_fd); -+ fsp->fsp_flags.is_pathref = false; ++ return NT_STATUS_OK; ++ } ++ } ++ } - fsp_set_fd(fsp, new_fd); - return NT_STATUS_OK; -+ return NT_STATUS_OK; -+ } - } - - /* +- } +- +- /* ++ /* + * Close the existing pathref fd and set the fsp flag + * is_pathref to false so we get a "normal" fd this time. + */