diff options
author | Michael Adam <obnox@samba.org> | 2007-05-22 22:00:16 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2007-05-22 22:00:16 +0000 |
commit | c83addaf01b21c5487a225594ad30495d54b71de (patch) | |
tree | 6b073d452cc7c3975359e6e949d01db6d7f6847c | |
parent | 6c0daaca49a0d4840481f0ff5f6b89c0b1b7be35 (diff) | |
download | samba-c83addaf01b21c5487a225594ad30495d54b71de.tar.gz samba-c83addaf01b21c5487a225594ad30495d54b71de.tar.xz samba-c83addaf01b21c5487a225594ad30495d54b71de.zip |
r23085: Activate the winbindd validation code in 3_0_26, too.
Original comment of the 3_0 checkin (r23040):
Activate the winbindd cache validation code in the
winbindd main function.
I have tested and somewhat extended the code, and it seems
to do a good job. I have possibly not caught all error
conditions though.
Michael
-rw-r--r-- | source/nsswitch/winbindd.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index a40c55ed8f4..458da53c1ac 100644 --- a/source/nsswitch/winbindd.c +++ b/source/nsswitch/winbindd.c @@ -1065,6 +1065,20 @@ 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 |