summaryrefslogtreecommitdiffstats
path: root/source/winbindd
diff options
context:
space:
mode:
authorAndreas Schneider <anschneider@suse.de>2007-11-23 10:54:48 +0100
committerMichael Adam <obnox@samba.org>2007-12-12 13:51:13 +0100
commitaabe9b33fcaed8af98b1ed6b736253e196d87d48 (patch)
tree436b4708f78b5ce0cc424f735627cc1d52f0e7aa /source/winbindd
parentce7fe8acf41e90553431c7cda6823700701835c7 (diff)
downloadsamba-aabe9b33fcaed8af98b1ed6b736253e196d87d48.tar.gz
samba-aabe9b33fcaed8af98b1ed6b736253e196d87d48.tar.xz
samba-aabe9b33fcaed8af98b1ed6b736253e196d87d48.zip
Don't restart winbind if a corrupted tdb is found during initialization.
The tdb is validated before it gets initialized. Since then sighandlers changed a restart isn't needed anymore.
Diffstat (limited to 'source/winbindd')
-rw-r--r--source/winbindd/winbindd.c24
-rw-r--r--source/winbindd/winbindd_cache.c3
2 files changed, 10 insertions, 17 deletions
diff --git a/source/winbindd/winbindd.c b/source/winbindd/winbindd.c
index b695c2e95ee..07cf22618e4 100644
--- a/source/winbindd/winbindd.c
+++ b/source/winbindd/winbindd.c
@@ -1157,20 +1157,6 @@ int main(int argc, char **argv, char **envp)
pidfile_create("winbindd");
- /* Ensure all cache and idmap caches are consistent
- before we startup. */
-
- if (winbindd_validate_cache()) {
- /* We have a bad cache, but luckily we
- just deleted it. Restart ourselves */
- int i;
- /* Ensure we have no open low fd's. */
- for (i = 3; i < 100; i++) {
- close(i);
- }
- return execve(argv[0], argv, envp);
- }
-
#if HAVE_SETPGID
/*
* If we're interactive we want to set our own process group for
@@ -1188,7 +1174,15 @@ int main(int argc, char **argv, char **envp)
DEBUG(0, ("unable to initialize messaging system\n"));
exit(1);
}
-
+
+ /*
+ * Ensure all cache and idmap caches are consistent
+ * before we startup.
+ */
+ if (winbindd_validate_cache() < 0) {
+ DEBUG(0, ("corrupted tdb found, trying to restore backup\n"));
+ }
+
/* Initialize cache (ensure version is correct). */
if (!initialize_winbindd_cache()) {
exit(1);
diff --git a/source/winbindd/winbindd_cache.c b/source/winbindd/winbindd_cache.c
index f3aa0fce42c..7ec8208f4b3 100644
--- a/source/winbindd/winbindd_cache.c
+++ b/source/winbindd/winbindd_cache.c
@@ -3338,8 +3338,7 @@ static void validate_panic(const char *const why)
/***********************************************************************
Try and validate every entry in the winbindd cache. If we fail here,
- delete the cache tdb and return non-zero - the caller (main winbindd
- function) will restart us as we don't know if we crashed or not.
+ delete the cache tdb and return non-zero.
***********************************************************************/
int winbindd_validate_cache(void)