The Samba-Bugzilla – Attachment 16714 Details for
Bug 14779
Winbind should not start if the socket path is too long
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.15
0001-s3-winbindd-Add-a-check-for-the-path-length-of-winbi.patch (text/plain), 1.76 KB, created by
Andreas Schneider
on 2021-08-04 09:00:45 UTC
(
hide
)
Description:
patch for 4.15
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2021-08-04 09:00:45 UTC
Size:
1.76 KB
patch
obsolete
>From b1160e6fc8b8bb05ff5463500f56ff92042000fc Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Tue, 3 Aug 2021 11:04:37 +0200 >Subject: [PATCH] s3:winbindd: Add a check for the path length of 'winbindd > socket directory' > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14779 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >(cherry picked from commit aab5cc95e224fef0efafeb1c37a4eb414aee65a0) >--- > source3/winbindd/winbindd.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > >diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c >index 4f367d07ecb..89e62b43ca0 100644 >--- a/source3/winbindd/winbindd.c >+++ b/source3/winbindd/winbindd.c >@@ -1658,6 +1658,7 @@ int main(int argc, const char **argv) > bool ok; > const struct dcesrv_endpoint_server *ep_server = NULL; > struct dcesrv_context *dce_ctx = NULL; >+ size_t winbindd_socket_dir_len = 0; > > setproctitle_init(argc, discard_const(argv), environ); > >@@ -1810,6 +1811,30 @@ int main(int argc, const char **argv) > } > } > >+ winbindd_socket_dir_len = strlen(lp_winbindd_socket_directory()); >+ if (winbindd_socket_dir_len > 0) { >+ size_t winbindd_socket_len = >+ winbindd_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_socket_len >= sun_path_len) { >+ DBG_ERR("The winbind socket path [%s/%s] is too long " >+ "(%zu >= %zu)\n", >+ lp_winbindd_socket_directory(), >+ WINBINDD_SOCKET_NAME, >+ winbindd_socket_dir_len, >+ sun_path_len); >+ exit(1); >+ } >+ } else { >+ DBG_ERR("'winbindd_socket_directory' parameter is empty\n"); >+ exit(1); >+ } >+ > if (!cluster_probe_ok()) { > exit(1); > } >-- >2.32.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14779
:
16714
|
16717
|
16741