summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-09-02 00:23:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:28 -0500
commit60abd094fa8af84a4f0db213143bc262e6b28ff9 (patch)
treee22438d79bcf26b7489f67cd5e315f5e6fe43764
parentc3678b45df9faba9680c0a4e790b446bb3e7ac62 (diff)
downloadsamba-60abd094fa8af84a4f0db213143bc262e6b28ff9.tar.gz
samba-60abd094fa8af84a4f0db213143bc262e6b28ff9.tar.bz2
samba-60abd094fa8af84a4f0db213143bc262e6b28ff9.zip
r24877: Don't panic in tdb validation code when the fork or waitpid fails.
Return error instead. Michael (This used to be commit 9b25355dd66519afd548fecbf2da7608b024a35b)
-rw-r--r--source3/lib/util_tdb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c
index a6f3e2e21c..c122b1ba45 100644
--- a/source3/lib/util_tdb.c
+++ b/source3/lib/util_tdb.c
@@ -1097,7 +1097,8 @@ int tdb_validate(struct tdb_context *tdb, tdb_validate_data_func validate_fn)
exit(tdb_validate_child(tdb, validate_fn));
}
else if (child_pid < 0) {
- smb_panic("tdb_validate: fork for validation failed.");
+ DEBUG(1, ("tdb_validate: fork for validation failed.\n"));
+ goto done;
}
/* parent */
@@ -1112,14 +1113,14 @@ int tdb_validate(struct tdb_context *tdb, tdb_validate_data_func validate_fn)
errno = 0;
continue;
}
- DEBUG(0, ("tdb_validate: waitpid failed with errno %s\n",
+ DEBUG(1, ("tdb_validate: waitpid failed with error '%s'.\n",
strerror(errno)));
- smb_panic("tdb_validate: waitpid failed.");
+ goto done;
}
if (wait_pid != child_pid) {
- DEBUG(0, ("tdb_validate: waitpid returned pid %d, "
+ DEBUG(1, ("tdb_validate: waitpid returned pid %d, "
"but %d was expected\n", wait_pid, child_pid));
- smb_panic("tdb_validate: waitpid returned unexpected PID.");
+ goto done;
}
DEBUG(10, ("tdb_validate: validating child returned.\n"));
@@ -1144,6 +1145,7 @@ int tdb_validate(struct tdb_context *tdb, tdb_validate_data_func validate_fn)
ret = WSTOPSIG(child_status);
}
+done:
DEBUG(5, ("tdb_validate returning code '%d' for tdb '%s'\n", ret,
tdb_name(tdb)));