[SCM] Samba Shared Repository - branch master updated

Isaac Boukris iboukris at samba.org
Tue Jun 16 10:31:01 UTC 2020


The branch, master has been updated
       via  0a2fae2d479 s3:lib: Make sure that have_rsrc is initialized
       via  ccf1c2227e6 s3:smbd: Fix a possibile null pointer dereference
       via  e7204f3c9ee s4:torture: Make sure that ctx is initialized to NULL
       via  de493a3e3b5 s3:locking: Remove dead code
       via  9b34cee6108 s3:rpc_server: Check return code of set_blocking()
       via  c57276cae62 s3:samr: Add missing NULL pointer check
       via  e7d49266546 s3:notifyd: Check return value of lp_load_initial_only()
       via  155d9e0b403 s3:lib: Avoid a NULL pointer deref on log level 10
       via  6114a4a59b0 s3:rpc_server: Pass a pointer to add_filemeta()
      from  a4f2b8daee9 vfs: Move reparse point functions to util_reparse.c

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


- Log -----------------------------------------------------------------
commit 0a2fae2d4793c45b6d70878a100cddb57475bbad
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 15 10:46:12 2020 +0200

    s3:lib: Make sure that have_rsrc is initialized
    
    This is never set to false, only to true in the code.
    
    Found by clang.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>
    
    Autobuild-User(master): Isaac Boukris <iboukris at samba.org>
    Autobuild-Date(master): Tue Jun 16 10:30:17 UTC 2020 on sn-devel-184

commit ccf1c2227e623411602f3e936aaed6a9bce978d4
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 15 10:32:49 2020 +0200

    s3:smbd: Fix a possibile null pointer dereference
    
    Found by clang.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit e7204f3c9ee73b3673a263d2a7e5dfb9251906f5
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 18:08:13 2020 +0200

    s4:torture: Make sure that ctx is initialized to NULL
    
    If we go to done and call smbc_free_context() the pointer should be
    initialized.
    
    Found by clang.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit de493a3e3b5b8d54f62c45072e27f2fefd4af43a
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 17:56:30 2020 +0200

    s3:locking: Remove dead code
    
    Found by Coverity.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit 9b34cee610892a9241dd7128f5ee5f9e99029e92
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 17:38:36 2020 +0200

    s3:rpc_server: Check return code of set_blocking()
    
    Found by Coverity.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit c57276cae62f69be65cccfc92d5689ec6c9e28e4
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 17:35:55 2020 +0200

    s3:samr: Add missing NULL pointer check
    
    Found by Coverity.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit e7d4926654664fa09685bbc1897b68a3a0fbef8d
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 17:32:11 2020 +0200

    s3:notifyd: Check return value of lp_load_initial_only()
    
    Found by Coverity.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit 155d9e0b4034f5902050973421a50a62cf682cc3
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 17:21:16 2020 +0200

    s3:lib: Avoid a NULL pointer deref on log level 10
    
    Found by cppcheck.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

commit 6114a4a59b0ebb59da36223c1dd9f25d1d282869
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 10 17:09:39 2020 +0200

    s3:rpc_server: Pass a pointer to add_filemeta()
    
    Review with: git show -U10
    
    Found by cppcheck.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Isaac Boukris <iboukris at samba.org>

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

Summary of changes:
 source3/lib/adouble.c                        |  4 ++--
 source3/locking/posix.c                      | 11 +----------
 source3/rpc_server/mdssvc/mdssvc.c           |  6 ++++--
 source3/rpc_server/rpc_server.c              | 12 ++++++++++--
 source3/rpc_server/samr/srv_samr_chgpasswd.c |  3 +++
 source3/smbd/notifyd/notifydd.c              |  7 ++++++-
 source3/smbd/open.c                          |  2 +-
 source4/torture/libsmbclient/libsmbclient.c  |  2 +-
 8 files changed, 28 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c
index f593759c9a6..42b2e808d66 100644
--- a/source3/lib/adouble.c
+++ b/source3/lib/adouble.c
@@ -1842,7 +1842,7 @@ bool ad_unconvert(TALLOC_CTX *mem_ctx,
 	struct adouble *ad = NULL;
 	unsigned int num_streams = 0;
 	size_t to_convert = 0;
-	bool have_rsrc;
+	bool have_rsrc = false;
 	files_struct *fsp = NULL;
 	size_t i;
 	NTSTATUS status;
@@ -2391,7 +2391,7 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx,
 
 	DEBUG(10, ("ad_get(%s) called for %s\n",
 		   type == ADOUBLE_META ? "meta" : "rsrc",
-		   smb_fname->base_name));
+		   smb_fname != NULL ? smb_fname->base_name : "???"));
 
 	ad = ad_alloc(ctx, type);
 	if (ad == NULL) {
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index e2eda225590..6d55b292e00 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -581,8 +581,6 @@ static void fd_close_posix_fn(
 
 int fd_close_posix(const struct files_struct *fsp)
 {
-	int saved_errno = 0;
-	int ret;
 	NTSTATUS status;
 
 	if (!lp_locking(fsp->conn->params) ||
@@ -627,14 +625,7 @@ int fd_close_posix(const struct files_struct *fsp)
 	 * Finally close the fd associated with this fsp.
 	 */
 
-	ret = close(fsp->fh->fd);
-
-	if (ret == 0 && saved_errno != 0) {
-		errno = saved_errno;
-		ret = -1;
-	}
-
-	return ret;
+	return close(fsp->fh->fd);
 }
 
 /****************************************************************************
diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c
index d6edc1c1686..8e98276d642 100644
--- a/source3/rpc_server/mdssvc/mdssvc.c
+++ b/source3/rpc_server/mdssvc/mdssvc.c
@@ -1230,7 +1230,8 @@ static bool slrpc_fetch_attributes(struct mds_ctx *mds_ctx,
 	sl_array_t *fm_array;
 	sl_nil_t nil;
 	char *path = NULL;
-	struct stat_ex sb;
+	struct stat_ex sb = {0};
+	struct stat_ex *sp = NULL;
 	struct sl_inode_path_map *elem = NULL;
 	void *p;
 	TDB_DATA val = tdb_null;
@@ -1302,9 +1303,10 @@ static bool slrpc_fetch_attributes(struct mds_ctx *mds_ctx,
 		if (result != 0) {
 			goto error;
 		}
+		sp = &sb;
 	}
 
-	ok = add_filemeta(mds_ctx, reqinfo, fm_array, path, &sb);
+	ok = add_filemeta(mds_ctx, reqinfo, fm_array, path, sp);
 	if (!ok) {
 		goto error;
 	}
diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c
index 4037c81cfc8..9e57bc34559 100644
--- a/source3/rpc_server/rpc_server.c
+++ b/source3/rpc_server/rpc_server.c
@@ -382,7 +382,11 @@ NTSTATUS dcesrv_setup_ncacn_ip_tcp_socket(struct tevent_context *ev_ctx,
 	set_socket_options(state->fd, lp_socket_options());
 
 	/* Set server socket to non-blocking for the accept. */
-	set_blocking(state->fd, false);
+	rc = set_blocking(state->fd, false);
+	if (rc < 0) {
+		status = map_nt_error_from_unix_common(errno);
+		goto out;
+	}
 
 	rc = listen(state->fd, SMBD_LISTEN_BACKLOG);
 	if (rc == -1) {
@@ -612,7 +616,11 @@ NTSTATUS dcesrv_setup_ncalrpc_socket(struct tevent_context *ev_ctx,
 	}
 
 	/* Set server socket to non-blocking for the accept. */
-	set_blocking(state->fd, false);
+	rc = set_blocking(state->fd, false);
+	if (rc < 0) {
+		status = map_nt_error_from_unix_common(errno);
+		goto out;
+	}
 
 	errno = 0;
 	fde = tevent_add_fd(state->ev_ctx,
diff --git a/source3/rpc_server/samr/srv_samr_chgpasswd.c b/source3/rpc_server/samr/srv_samr_chgpasswd.c
index 8bc7af09ee9..cb9837ecf01 100644
--- a/source3/rpc_server/samr/srv_samr_chgpasswd.c
+++ b/source3/rpc_server/samr/srv_samr_chgpasswd.c
@@ -638,6 +638,9 @@ the string %%u, and the given string %s does not.\n", passwordprogram ));
 					chatsequence,
 					"%n",
 					newpass);
+	if (chatsequence == NULL) {
+		return false;
+	}
 	return chat_with_program(passwordprogram,
 				pass,
 				chatsequence,
diff --git a/source3/smbd/notifyd/notifydd.c b/source3/smbd/notifyd/notifydd.c
index faad4e73f3e..26bfcd8e410 100644
--- a/source3/smbd/notifyd/notifydd.c
+++ b/source3/smbd/notifyd/notifydd.c
@@ -39,7 +39,12 @@ int main(int argc, const char *argv[])
 	setup_logging("notifyd", DEBUG_DEFAULT_STDOUT);
 	lp_set_cmdline("log level", "10");
 
-	lp_load_initial_only(get_dyn_CONFIGFILE());
+	ok = lp_load_initial_only(get_dyn_CONFIGFILE());
+	if (!ok) {
+		fprintf(stderr, "Can't load %s - run testparm to debug it\n",
+			get_dyn_CONFIGFILE());
+		return 1;
+	}
 
 	ev = samba_tevent_context_init(frame);
 	if (ev == NULL) {
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 286f1b8e6f7..8f6d293c06f 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -6024,7 +6024,7 @@ NTSTATUS create_file_default(connection_struct *conn,
 
 		fake_file_type = is_fake_file(smb_fname);
 
-		if (fake_file_type != FAKE_FILE_TYPE_NONE) {
+		if (req != NULL && fake_file_type != FAKE_FILE_TYPE_NONE) {
 
 			/*
 			 * Here we go! support for changing the disk quotas
diff --git a/source4/torture/libsmbclient/libsmbclient.c b/source4/torture/libsmbclient/libsmbclient.c
index 18a1af3164b..3f3992593f9 100644
--- a/source4/torture/libsmbclient/libsmbclient.c
+++ b/source4/torture/libsmbclient/libsmbclient.c
@@ -815,7 +815,7 @@ static bool torture_libsmbclient_readdirplus_seek(struct torture_context *tctx)
 
 static bool torture_libsmbclient_readdirplus2(struct torture_context *tctx)
 {
-	SMBCCTX *ctx;
+	SMBCCTX *ctx = NULL;
 	int dhandle = -1;
 	int fhandle = -1;
 	bool found = false;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list