The Samba-Bugzilla – Attachment 7949 Details for
Bug 9218
Samba panics if a user specifies an invalid port number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v4-0-test patch
0001-s3-smbd-Don-t-segfault-if-user-specified-ports-out-f.patch (text/plain), 1.95 KB, created by
Andreas Schneider
on 2012-09-27 08:00:13 UTC
(
hide
)
Description:
v4-0-test patch
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2012-09-27 08:00:13 UTC
Size:
1.95 KB
patch
obsolete
>From 4e09d235d8a76b15da9f974532f5667a31a8fe48 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Tue, 25 Sep 2012 14:28:22 +0200 >Subject: [PATCH] s3-smbd: Don't segfault if user specified ports out for > range. > >Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> >Autobuild-Date(master): Wed Sep 26 16:28:44 CEST 2012 on sn-devel-104 >(cherry picked from commit 50d324b7e070de4672eff3fb6231923e6dca807a) > >Signed-off-by: Andreas Schneider <asn@samba.org> >--- > source3/smbd/server.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/source3/smbd/server.c b/source3/smbd/server.c >index d53b19a..0c030ea 100644 >--- a/source3/smbd/server.c >+++ b/source3/smbd/server.c >@@ -752,6 +752,15 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent, > ports = (const char **)str_list_make_v3(talloc_tos(), smb_ports, NULL); > } > >+ for (j = 0; ports && ports[j]; j++) { >+ unsigned port = atoi(ports[j]); >+ >+ if (port == 0 || port > 0xffff) { >+ exit_server_cleanly("Invalid port in the config or on " >+ "the commandline specified!"); >+ } >+ } >+ > if (lp_interfaces() && lp_bind_interfaces_only()) { > /* We have been given an interfaces line, and been > told to only bind to those interfaces. Create a >@@ -772,9 +781,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent, > > for (j = 0; ports && ports[j]; j++) { > unsigned port = atoi(ports[j]); >- if (port == 0 || port > 0xffff) { >- continue; >- } > > /* Keep the first port for mDNS service > * registration. >@@ -810,11 +816,7 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent, > next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,"); ) { > for (j = 0; ports && ports[j]; j++) { > struct sockaddr_storage ss; >- > unsigned port = atoi(ports[j]); >- if (port == 0 || port > 0xffff) { >- continue; >- } > > /* Keep the first port for mDNS service > * registration. >-- >1.7.12 >
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
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 9218
: 7949 |
7950
|
7951