summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-07-16 09:48:23 -0400
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-07-16 09:48:23 -0400
commitdb7bff1babdb556efa54b7ff02d66fb50e833a30 (patch)
treefc436d46a35ce503234aa20d60349795f8d28408 /source3/lib
parentdeac1761f0695053dec3557e06be5d53e7d189e2 (diff)
parentddc0d9deb32082a5d8d591800d638d0e96fa6ff3 (diff)
downloadsamba-db7bff1babdb556efa54b7ff02d66fb50e833a30.tar.gz
samba-db7bff1babdb556efa54b7ff02d66fb50e833a30.tar.bz2
samba-db7bff1babdb556efa54b7ff02d66fb50e833a30.zip
Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into v3-3-test
(This used to be commit 11d74fc51c637b8129304b5de85bbe02a86a69ce)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap.c25
-rw-r--r--source3/lib/netapi/examples/user/user_dispinfo.c4
-rw-r--r--source3/lib/popt_common.c6
3 files changed, 27 insertions, 8 deletions
diff --git a/source3/lib/dbwrap.c b/source3/lib/dbwrap.c
index 7fe1631bff..eec15a84bd 100644
--- a/source3/lib/dbwrap.c
+++ b/source3/lib/dbwrap.c
@@ -60,8 +60,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
sockname = CTDB_PATH;
}
- if (lp_clustering() && socket_exist(sockname)) {
+ if (lp_clustering()) {
const char *partname;
+
+ if (!socket_exist(sockname)) {
+ DEBUG(1, ("ctdb socket does not exist - is ctdb not "
+ "running?\n"));
+ return NULL;
+ }
+
/* ctdb only wants the file part of the name */
partname = strrchr(name, '/');
if (partname) {
@@ -76,8 +83,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
if (result == NULL) {
DEBUG(0,("failed to attach to ctdb %s\n",
partname));
- smb_panic("failed to attach to a ctdb "
- "database");
+ return NULL;
}
}
}
@@ -112,7 +118,7 @@ struct db_context *db_open_trans(TALLOC_CTX *mem_ctx,
if (tdb_flags & TDB_CLEAR_IF_FIRST) {
DEBUG(0,("db_open_trans: called with TDB_CLEAR_IF_FIRST: %s\n",
name));
- smb_panic("db_open_trans: called with TDB_CLEAR_IF_FIRST");
+ return NULL;
}
#ifdef CLUSTER_SUPPORT
@@ -120,8 +126,15 @@ struct db_context *db_open_trans(TALLOC_CTX *mem_ctx,
sockname = CTDB_PATH;
}
- if (lp_clustering() && socket_exist(sockname)) {
+ if (lp_clustering()) {
const char *partname;
+
+ if (!socket_exist(sockname)) {
+ DEBUG(1, ("ctdb socket does not exist - is ctdb not "
+ "running?\n"));
+ return NULL;
+ }
+
/* ctdb only wants the file part of the name */
partname = strrchr(name, '/');
if (partname) {
@@ -137,8 +150,6 @@ struct db_context *db_open_trans(TALLOC_CTX *mem_ctx,
if (result == NULL) {
DEBUG(0,("failed to attach to ctdb %s\n",
partname));
- smb_panic("failed to attach to a ctdb "
- "database");
}
return result;
}
diff --git a/source3/lib/netapi/examples/user/user_dispinfo.c b/source3/lib/netapi/examples/user/user_dispinfo.c
index 9f862505aa..23024fe9fe 100644
--- a/source3/lib/netapi/examples/user/user_dispinfo.c
+++ b/source3/lib/netapi/examples/user/user_dispinfo.c
@@ -78,11 +78,13 @@ int main(int argc, const char **argv)
if (status == 0 || status == ERROR_MORE_DATA) {
user = (struct NET_DISPLAY_USER *)buffer;
for (i=0; i<entries_read; i++) {
- printf("user %d: %s\n", i, user->usri1_name);
+ printf("user %d: %s\n", i + idx,
+ user->usri1_name);
user++;
}
NetApiBufferFree(buffer);
}
+ idx += entries_read;
} while (status == ERROR_MORE_DATA);
if (status != 0) {
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index 25e41ab5f3..b151f22742 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -171,6 +171,12 @@ struct poptOption popt_common_version[] = {
POPT_TABLEEND
};
+struct poptOption popt_common_debuglevel[] = {
+ { NULL, 0, POPT_ARG_CALLBACK, (void *)popt_common_callback },
+ { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
+ POPT_TABLEEND
+};
+
/* Handle command line options:
* --sbindir