[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Fri Nov 25 07:00:02 MST 2011
The branch, master has been updated
via 37f7a2c s3:locking:posix: remove uses of SMB_ASSERT() from get_windows_lock_ref_count()
via 95e686d s3:locking:posix: adapt use of dbrwrap_fetch() to new NTSTATUS semantics
via 3a2fd7c s3:registry: write INFO/version if we create registry.tdb
via a719ce7 s3:dbwrap: do not burden the user of db_open_ctdb with ifdef voodoo
via 90eb2eb s3:lib fix output of hex escapes > 0x7F with cbuf_print_quoted (cherry picked from commit a1fcb7e37a23dcc035686486d4afe32a67082ae1)
via 2d9b401 s3:net registry check: improve console output
via 9b42b8a socket_wrapper: use libreplace headers based on "#ifdef HAVE_LIBREPLACE"
via 87026b6 socket_wrapper: simplify include path for replace.h
from 47a94f7 s3: user_domain is not used in wb_getpwsid
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 37f7a2c82d76fd5b9997686d8cbf1cf8a2180aac
Author: Michael Adam <obnox at samba.org>
Date: Thu Nov 10 23:11:54 2011 +0100
s3:locking:posix: remove uses of SMB_ASSERT() from get_windows_lock_ref_count()
SMB_ASSERT is useless, since in non-developer build it does not actually
fail after the log message, but usual flow just continues.
Autobuild-User: Michael Adam <obnox at samba.org>
Autobuild-Date: Fri Nov 25 14:59:53 CET 2011 on sn-devel-104
commit 95e686d59c2e712b4e030c770a37dde18837e222
Author: Michael Adam <obnox at samba.org>
Date: Thu Nov 10 22:55:28 2011 +0100
s3:locking:posix: adapt use of dbrwrap_fetch() to new NTSTATUS semantics
commit 3a2fd7c0e213e0fefed40eaa31a2282b126f2be4
Author: Gregor Beck <gbeck at sernet.de>
Date: Mon Nov 7 13:31:26 2011 +0100
s3:registry: write INFO/version if we create registry.tdb
Signed-off-by: Michael Adam <obnox at samba.org>
commit a719ce7c11c2c8c8b006c94b4559ef5e8addbc1a
Author: Gregor Beck <gbeck at sernet.de>
Date: Tue Oct 25 16:32:12 2011 +0200
s3:dbwrap: do not burden the user of db_open_ctdb with ifdef voodoo
Signed-off-by: Michael Adam <obnox at samba.org>
commit 90eb2eb1789e430b4ad8c849d7df99f5d8315a06
Author: Gregor Beck <gbeck at sernet.de>
Date: Fri Oct 21 10:49:45 2011 +0200
s3:lib fix output of hex escapes > 0x7F with cbuf_print_quoted
(cherry picked from commit a1fcb7e37a23dcc035686486d4afe32a67082ae1)
commit 2d9b4015d6835fa9b83f9945cb94ca289c5ab5c7
Author: Gregor Beck <gbeck at sernet.de>
Date: Fri Oct 21 15:32:27 2011 +0200
s3:net registry check: improve console output
Signed-off-by: Michael Adam <obnox at samba.org>
commit 9b42b8a346b80ff5df9125c2ba27315ef3bc57e5
Author: Michael Adam <obnox at samba.org>
Date: Sun Nov 20 23:45:05 2011 +0100
socket_wrapper: use libreplace headers based on "#ifdef HAVE_LIBREPLACE"
instead of "#ifdef _SAMBA_BUILD_".
This is to be able to use socket_wrapper in other projects
that also use libreplace.
commit 87026b6dc360d7caf5dcc0f49d67f51e924314fe
Author: Michael Adam <obnox at samba.org>
Date: Fri Nov 18 15:37:07 2011 +0100
socket_wrapper: simplify include path for replace.h
-----------------------------------------------------------------------
Summary of changes:
lib/socket_wrapper/socket_wrapper.c | 10 ++++++----
source3/lib/cbuf.c | 2 +-
source3/lib/dbwrap/dbwrap_ctdb.c | 13 +++++++++++++
source3/lib/dbwrap/dbwrap_ctdb.h | 3 ---
source3/locking/posix.c | 30 +++++++++++++++++++++++++-----
source3/registry/reg_backend_db.c | 7 +++++++
source3/utils/net_registry_check.c | 11 ++++-------
7 files changed, 56 insertions(+), 20 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index a54f50f..2c24ab7 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -39,15 +39,17 @@
is set.
*/
-#ifdef _SAMBA_BUILD_
+#include "config.h"
+
+#ifdef HAVE_LIBREPLACE
#define SOCKET_WRAPPER_NOT_REPLACE
-#include "../replace/replace.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/time.h"
-#else /* _SAMBA_BUILD_ */
+#else /* HAVE_LIBREPLACE */
#include <sys/types.h>
#include <sys/time.h>
@@ -66,7 +68,7 @@
#include <stdio.h>
#include <stdint.h>
-#endif
+#endif /* HAVE_LIBREPLACE */
#ifndef _PUBLIC_
#define _PUBLIC_
diff --git a/source3/lib/cbuf.c b/source3/lib/cbuf.c
index 42353f8..611aa80 100644
--- a/source3/lib/cbuf.c
+++ b/source3/lib/cbuf.c
@@ -306,7 +306,7 @@ int cbuf_print_quoted(cbuf* ost, const char* s, size_t len)
if (isprint(*s) && ((*s == ' ') || !isspace(*s))) {
ret = cbuf_putc(ost, *s);
} else {
- ret = cbuf_printf(ost, "\\%02x", *s);
+ ret = cbuf_printf(ost, "\\%02x", (uchar)*s);
}
}
s++;
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 38a3395..aae5c06 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -22,6 +22,7 @@
#include "system/filesys.h"
#include "lib/util/tdb_wrap.h"
#include "util_tdb.h"
+#include "dbwrap/dbwrap_ctdb.h"
#include "dbwrap/dbwrap_rbt.h"
#include "lib/param/param.h"
@@ -1526,4 +1527,16 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
return result;
}
+
+#else /* CLUSTER_SUPPORT */
+
+struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
+ const char *name,
+ int hash_size, int tdb_flags,
+ int open_flags, mode_t mode)
+{
+ DEBUG(3, ("db_open_ctdb: no cluster support!\n"));
+ return NULL;
+}
+
#endif
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.h b/source3/lib/dbwrap/dbwrap_ctdb.h
index 13ce140..7898818 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.h
+++ b/source3/lib/dbwrap/dbwrap_ctdb.h
@@ -21,8 +21,6 @@
#ifndef __DBWRAP_CTDB_H__
#define __DBWRAP_CTDB_H__
-#ifdef CLUSTER_SUPPORT
-
#include <talloc.h>
struct db_context;
@@ -31,6 +29,5 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode);
-#endif /* CLUSTER_SUPPORT */
#endif /* __DBWRAP_CTDB_H__ */
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index a28744a..0ff2395 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -513,14 +513,29 @@ static int get_windows_lock_ref_count(files_struct *fsp)
posix_pending_close_db, talloc_tos(),
locking_ref_count_key_fsp(fsp, &tmp), &dbuf);
- SMB_ASSERT(NT_STATUS_IS_OK(status));
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+ goto done;
+ }
- if (dbuf.dsize != 0) {
- SMB_ASSERT(dbuf.dsize == sizeof(lock_ref_count));
- memcpy(&lock_ref_count, dbuf.dptr, sizeof(lock_ref_count));
- TALLOC_FREE(dbuf.dptr);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("get_windows_lock_ref_count: Error fetching "
+ "lock ref count for file %s: %s\n",
+ fsp_str_dbg(fsp), nt_errstr(status)));
+ goto done;
}
+ if (dbuf.dsize != sizeof(lock_ref_count)) {
+ DEBUG(0, ("get_windows_lock_ref_count: invalid entry "
+ "in lock ref count record for file %s: "
+ "(invalid data size %u)\n",
+ fsp_str_dbg(fsp), (unsigned int)dbuf.dsize));
+ goto done;
+ }
+
+ memcpy(&lock_ref_count, dbuf.dptr, sizeof(lock_ref_count));
+ TALLOC_FREE(dbuf.dptr);
+
+done:
DEBUG(10,("get_windows_lock_count for file %s = %d\n",
fsp_str_dbg(fsp), lock_ref_count));
@@ -623,6 +638,11 @@ static size_t get_posix_pending_close_entries(TALLOC_CTX *mem_ctx,
posix_pending_close_db, mem_ctx, fd_array_key_fsp(fsp),
&dbuf);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+ *entries = NULL;
+ return 0;
+ }
+
SMB_ASSERT(NT_STATUS_IS_OK(status));
if (dbuf.dsize == 0) {
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 4d4aaeb..b306b2c 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -656,6 +656,13 @@ WERROR regdb_init(void)
return werr;
}
+ werr = regdb_store_regdb_version(regdb, REGDB_CODE_VERSION);
+ if (!W_ERROR_IS_OK(werr)) {
+ DEBUG(1, ("regdb_init: Failed to store version: %s\n",
+ win_errstr(werr)));
+ return werr;
+ }
+
DEBUG(10,("regdb_init: Successfully created registry tdb\n"));
}
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 0936aea..8e67edd 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -874,7 +874,7 @@ static bool get_version(struct check_ctx *ctx) {
"version %d with %d\n", info_version, version);
} else {
printf("Warning: found registry format version %d but "
- "expected %d\n", info_version, version);
+ "expected %d, use --force to proceed.\n", info_version, version);
return false;
}
}
@@ -1191,15 +1191,13 @@ static bool check_ctx_fix_inplace(struct check_ctx *ctx) {
NTSTATUS status;
status = dbwrap_traverse(ctx->reg, fix_tree_action, ctx, NULL);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("fix traverse failed: %s\n",
- nt_errstr(status)));
+ DEBUG(0, ("fix traverse failed: %s\n", nt_errstr(status)));
return false;
}
status = dbwrap_traverse(ctx->del, delete_invalid_action, ctx, NULL);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("delete traverse failed: %s\n",
- nt_errstr(status)));
+ DEBUG(0, ("delete traverse failed: %s\n", nt_errstr(status)));
return false;
}
return true;
@@ -1213,8 +1211,7 @@ static bool check_ctx_write_new_db(struct check_ctx *ctx) {
if (ctx->opt.wipe) {
int ret = dbwrap_wipe(ctx->odb);
if (ret != 0) {
- DEBUG(0, ("wiping %s failed\n",
- ctx->opt.output));
+ DEBUG(0, ("wiping %s failed\n", ctx->opt.output));
return false;
}
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list