Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144607432
D50778.1775722261.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D50778.1775722261.diff
View Options
diff --git a/net/samba420/Makefile b/net/samba420/Makefile
--- 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
--- 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/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 @@
- };
- 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 @@
- 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 @@
- 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.
+ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 8:11 AM (18 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28307636
Default Alt Text
D50778.1775722261.diff (5 KB)
Attached To
Mode
D50778: [PATCH] net/samba420: Unbreak samba 4.20
Attached
Detach File
Event Timeline
Log In to Comment