[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Aug 12 20:09:01 UTC 2021


The branch, master has been updated
       via  25941a1f972 s3:winbindd: Pass the right variable to the debug message
       via  45f6bf1824f s3:winbind: Do not start if the priviliged socket path is too long
      from  8858cf72af1 wscript: fix installing pre-commit with 'git worktree'

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


- Log -----------------------------------------------------------------
commit 25941a1f97229ef27ee5ac7cc6bc9e7a300fcca0
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 11 14:58:39 2021 +0200

    s3:winbindd: Pass the right variable to the debug message
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14779
    
    Signed-off-by: Andreas Schneider <asn 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 12 20:08:25 UTC 2021 on sn-devel-184

commit 45f6bf1824f229dd138280eed1fff61a1e291897
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 11 12:07:57 2021 +0200

    s3:winbind: Do not start if the priviliged socket path is too long
    
    https://bugzilla.samba.org/show_bug.cgi?id=14792
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 source3/winbindd/winbindd.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 89e62b43ca0..cb793cf182c 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -1659,6 +1659,8 @@ int main(int argc, const char **argv)
 	const struct dcesrv_endpoint_server *ep_server = NULL;
 	struct dcesrv_context *dce_ctx = NULL;
 	size_t winbindd_socket_dir_len = 0;
+	char *winbindd_priv_socket_dir = NULL;
+	size_t winbindd_priv_socket_dir_len = 0;
 
 	setproctitle_init(argc, discard_const(argv), environ);
 
@@ -1826,7 +1828,7 @@ int main(int argc, const char **argv)
 				"(%zu >= %zu)\n",
 				lp_winbindd_socket_directory(),
 				WINBINDD_SOCKET_NAME,
-				winbindd_socket_dir_len,
+				winbindd_socket_len,
 				sun_path_len);
 			exit(1);
 		}
@@ -1835,6 +1837,32 @@ int main(int argc, const char **argv)
 		exit(1);
 	}
 
+	winbindd_priv_socket_dir = get_winbind_priv_pipe_dir();
+	winbindd_priv_socket_dir_len = strlen(winbindd_priv_socket_dir);
+	if (winbindd_priv_socket_dir_len > 0) {
+		size_t winbindd_priv_socket_len =
+			winbindd_priv_socket_dir_len + 1 +
+			strlen(WINBINDD_SOCKET_NAME);
+		struct sockaddr_un un = {
+			.sun_family = AF_UNIX,
+		};
+		size_t sun_path_len = sizeof(un.sun_path);
+
+		if (winbindd_priv_socket_len >= sun_path_len) {
+			DBG_ERR("The winbind priviliged socket path [%s/%s] is too long "
+				"(%zu >= %zu)\n",
+				winbindd_priv_socket_dir,
+				WINBINDD_SOCKET_NAME,
+				winbindd_priv_socket_len,
+				sun_path_len);
+			exit(1);
+		}
+	} else {
+		DBG_ERR("'winbindd_priv_socket_directory' parameter is empty\n");
+		exit(1);
+	}
+	TALLOC_FREE(winbindd_priv_socket_dir);
+
 	if (!cluster_probe_ok()) {
 		exit(1);
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list