[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Aug 4 21:47:01 UTC 2022


The branch, master has been updated
       via  972dd999b8d smbd: Fix a "set but not used" warning
       via  99020ffef2f smbd: Security fix for systems without O_PATH
       via  c89ae5f0f65 lib: Align an integer type
       via  0b58dc38bb8 smbd: Fix the build on FreeBSD
      from  46418dddda9 s3: smbd: Convert driver_unix_convert() to use filename_convert_dirfsp().

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 972dd999b8d67f22434db83492d9ccc2efe06300
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 2 13:08:43 2022 +0200

    smbd: Fix a "set but not used" warning
    
    This is copy&paste from reply_negprot() where this variable was used
    to set the remote architecture. This isn't used anymore in the
    stripped down smb2 version of this.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Aug  4 21:46:23 UTC 2022 on sn-devel-184

commit 99020ffef2f741dcd72df6ae2d41f9ccf6b88a13
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 4 16:44:44 2022 +0200

    smbd: Security fix for systems without O_PATH
    
    Further up we add O_PATH manually. Initial development versions of
    this code did set the is_pathref, but then I found this potential
    problem. I forgot to remove this incarnation of is_pathref=true, doing
    it now.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c89ae5f0f65d727bd7084a52175089aa60dda428
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 3 11:05:33 2022 +0200

    lib: Align an integer type
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0b58dc38bb810cc2c5a516a8f4f3017d7812ee0a
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 22 19:17:29 2022 +0200

    smbd: Fix the build on FreeBSD
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/replace/xattr.c         | 3 ++-
 source3/smbd/files.c        | 5 ++---
 source3/smbd/smb2_negprot.c | 9 ---------
 source3/smbd/statvfs.c      | 2 +-
 4 files changed, 5 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/xattr.c b/lib/replace/xattr.c
index 01215f1a9f3..4869367b7da 100644
--- a/lib/replace/xattr.c
+++ b/lib/replace/xattr.c
@@ -210,7 +210,8 @@ typedef union {
 static ssize_t bsd_attr_list (int type, extattr_arg arg, char *list, size_t size)
 {
 	ssize_t list_size, total_size = 0;
-	int i, t, len;
+	int i, len;
+	size_t t;
 	char *buf;
 	/* Iterate through extattr(2) namespaces */
 	for(t = 0; t < ARRAY_SIZE(extattr); t++) {
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index afde81d3070..62ca9fc1c8f 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -762,8 +762,8 @@ NTSTATUS openat_pathref_dirfsp_nosymlink(
 #ifdef O_PATH
 	/*
 	 * Add O_PATH manually, doing this by setting
-	 * fsp->fsp_flags.is_pathref will make us become_root(), which
-	 * would cause a security problem.
+	 * fsp->fsp_flags.is_pathref will make us become_root() in the
+	 * non-O_PATH case, which would cause a security problem.
 	 */
 	flags |= O_PATH;
 #else
@@ -901,7 +901,6 @@ next:
 					  nt_errstr(status));
 				goto fail;
 			}
-			fsp->fsp_flags.is_pathref = true;
 			fsp->fsp_name = &full_fname;
 		} else {
 			fsp = tmp;
diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c
index da567951c0b..baddbecaade 100644
--- a/source3/smbd/smb2_negprot.c
+++ b/source3/smbd/smb2_negprot.c
@@ -1053,7 +1053,6 @@ NTSTATUS smb2_multi_protocol_reply_negprot(struct smb_request *req)
 	bool choice_set = false;
 	int protocol;
 	const char *p;
-	int protocols = 0;
 	int num_cliprotos;
 	char **cliprotos;
 	size_t i;
@@ -1117,14 +1116,6 @@ NTSTATUS smb2_multi_protocol_reply_negprot(struct smb_request *req)
 		p += strlen(p) + 2;
 	}
 
-	for (i=0; i<num_cliprotos; i++) {
-		if (strcsequal(cliprotos[i], "SMB 2.002")) {
-			protocols |= PROT_SMB_2_002;
-		} else if (strcsequal(cliprotos[i], "SMB 2.???")) {
-			protocols |= PROT_SMB_2_FF;
-		}
-	}
-
 	/* possibly reload - change of architecture */
 	reload_services(sconn, conn_snum_used, true);
 
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index 981e7a5ba79..03dacc4ccc7 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -76,7 +76,7 @@ static int darwin_fs_capabilities(const char * path)
 #endif /* DARWINOS */
 
 #if defined(BSD_STYLE_STATVFS)
-static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
+static int bsd_statvfs(const char *path, struct vfs_statvfs_struct *statbuf)
 {
 	struct statfs sbuf;
 	int ret;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list