[SCM] Samba Shared Repository - branch v3-6-test updated

Volker Lendecke vlendec at samba.org
Sat Jan 8 04:56:32 MST 2011


The branch, v3-6-test has been updated
       via  625118d s3: Avoid a ton of registry writes at startup
       via  d73e2dd s3: Fix a type error
       via  f29a453 s3: Fix some nonempty blank lines
      from  85cbe4a Explicitly set "nmbd: socket dir" in the test environment. (cherry picked from commit 12277bb5f5e6b3cd0e9158ebda3c1746fc25bb4a)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 625118daf6dacbbfd260b4c755c40acda16bc74f
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Jan 8 11:51:17 2011 +0100

    s3: Avoid a ton of registry writes at startup
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sat Jan  8 12:39:09 CET 2011 on sn-devel-104

commit d73e2dd2aeecd4377e214a6eec02dce93431ec50
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Jan 8 11:28:47 2011 +0100

    s3: Fix a type error

commit f29a453cc8d0bb57aab8c1833ca6d746a896d3d8
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Jan 8 11:28:27 2011 +0100

    s3: Fix some nonempty blank lines

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

Summary of changes:
 source3/services/services_db.c |   18 ++++++++++++++++++
 source3/web/diagnose.c         |   10 +++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index ca375d2..03f7951 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -270,6 +270,24 @@ static WERROR svcctl_setvalue(struct registry_key *key,
 			      struct registry_value *value)
 {
 	WERROR wresult;
+	struct registry_value *existing;
+
+	wresult = reg_queryvalue(talloc_tos(), key, name, &existing);
+	if (W_ERROR_IS_OK(wresult)) {
+		bool exists;
+
+		exists = ((value->type == existing->type) &&
+			  (data_blob_cmp(&value->data, &existing->data) == 0));
+
+		TALLOC_FREE(existing);
+
+		if (exists) {
+			/*
+			 * Avoid an expensive write when not necessary
+			 */
+			return WERR_OK;
+		}
+	}
 
 	wresult = reg_setvalue(key, name, value);
 	if (!W_ERROR_IS_OK(wresult)) {
diff --git a/source3/web/diagnose.c b/source3/web/diagnose.c
index fb95f0f..4a44012 100644
--- a/source3/web/diagnose.c
+++ b/source3/web/diagnose.c
@@ -2,17 +2,17 @@
    Unix SMB/CIFS implementation.
    diagnosis tools for web admin
    Copyright (C) Andrew Tridgell 1998
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -35,7 +35,7 @@ bool winbindd_running(void)
 bool nmbd_running(void)
 {
 	struct in_addr loopback_ip;
-	int count, flags;
+	int count;
 	struct sockaddr_storage *ss_list;
 	struct sockaddr_storage ss;
 	NTSTATUS status;
@@ -46,7 +46,7 @@ bool nmbd_running(void)
 	status = name_query("__SAMBA__", 0,
 			    True, True, &ss,
 			    talloc_tos(), &ss_list, &count,
-			    &flags);
+			    NULL);
 	if (NT_STATUS_IS_OK(status)) {
 		TALLOC_FREE(ss_list);
 		return True;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list