[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Thu Mar 26 23:39:03 MDT 2015
The branch, master has been updated
via 0c7b69b selftest: Use 'logging' parameter instead of 'syslog'
via 3fb40b4 s4-process_model: Panic if the standard init function fails
via f751828 s4-process_model: Do not close random fds while forking.
from 14b6e0a s4:kdc/db-glue: samba_kdc_trust_message2entry() should use the normalized principal as salt
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0c7b69b10b0e8b8bd580e835466411ec83daf98c
Author: Christof Schmitt <cs at samba.org>
Date: Mon Mar 23 16:16:36 2015 -0700
selftest: Use 'logging' parameter instead of 'syslog'
'syslog' has been deprecated, so use the new 'logging' parameter
instead.
Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Fri Mar 27 06:38:32 CET 2015 on sn-devel-104
commit 3fb40b4bec0ca8e035e0e2e9e7b435ebfcedf3eb
Author: Andreas Schneider <asn at samba.org>
Date: Thu Mar 26 10:58:18 2015 +0100
s4-process_model: Panic if the standard init function fails
Pair-Programmed-With: Michael Adam <obnox at samba.org>
Signed-off-by: Andreas Schneider <asn at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit f75182841d4a7d63bd070022270926e324631fa9
Author: Andreas Schneider <asn at samba.org>
Date: Thu Mar 26 10:48:31 2015 +0100
s4-process_model: Do not close random fds while forking.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11180
The issue has been found with nss_wrapper debug output running:
samba4.ntvfs.cifs.krb5.base.lock
In the case here, we fork a child and close the fd without resetting
the pipe fd variable. Then the fd was used to open the nss_wrapper
hosts file which got the same fd. We forked again in the process model
called close() on the re-used fd (of the pipe variable) again without
nss_wrapper noticing. Now Samba opened the secrets tdb and got
the same fd as nss_wrapper was using for the hosts file and next
nss_wrapper tried to parse a TDB ...
Pair-Programmed-With: Michael Adam <obnox at samba.org>
Signed-off-by: Andreas Schneider <asn at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
-----------------------------------------------------------------------
Summary of changes:
selftest/target/Samba3.pm | 2 +-
selftest/target/Samba4.pm | 2 +-
source4/smbd/process_standard.c | 19 +++++++++++++++----
3 files changed, 17 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 097d90a..3f2d247 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1154,7 +1154,7 @@ sub provision($$$$$$$$)
kernel change notify = no
smb2 leases = yes
- syslog = no
+ logging = file
printing = bsd
printcap name = /dev/null
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 40e13fc..9d765c4 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1689,7 +1689,7 @@ sub provision_ad_dc($$)
kernel oplocks = no
kernel change notify = no
- syslog = no
+ logging = file
printing = bsd
printcap name = /dev/null
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index d3622f9..e2b9f13 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -42,14 +42,19 @@ NTSTATUS process_model_standard_init(void);
/* we hold a pipe open in the parent, and the any child
processes wait for EOF on that pipe. This ensures that
children die when the parent dies */
-static int child_pipe[2];
+static int child_pipe[2] = { -1, -1 };
/*
called when the process model is selected
*/
static void standard_model_init(void)
{
- pipe(child_pipe);
+ int rc;
+
+ rc = pipe(child_pipe);
+ if (rc < 0) {
+ smb_panic("Failed to initialze pipe!");
+ }
}
/*
@@ -266,7 +271,10 @@ static void standard_accept_connection(struct tevent_context *ev,
tevent_add_fd(ev, ev, child_pipe[0], TEVENT_FD_READ,
standard_pipe_handler, NULL);
- close(child_pipe[1]);
+ if (child_pipe[1] != -1) {
+ close(child_pipe[1]);
+ child_pipe[1] = -1;
+ }
/* Ensure that the forked children do not expose identical random streams */
set_need_random_reseed();
@@ -342,7 +350,10 @@ static void standard_new_task(struct tevent_context *ev,
tevent_add_fd(ev, ev, child_pipe[0], TEVENT_FD_READ,
standard_pipe_handler, NULL);
- close(child_pipe[1]);
+ if (child_pipe[1] != -1) {
+ close(child_pipe[1]);
+ child_pipe[1] = -1;
+ }
/* Ensure that the forked children do not expose identical random streams */
set_need_random_reseed();
--
Samba Shared Repository
More information about the samba-cvs
mailing list