summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-09-17 08:35:07 +0000
committerAndrew Tridgell <tridge@samba.org>1998-09-17 08:35:07 +0000
commit9edd43dcd6cc040416f11e00320c53682558fd8a (patch)
tree46c9558f3a73c3ce433028b02d22ade41d8246b8
parent5e6488d4830016ea720a644c1b1ae25b336d3b8b (diff)
downloadsamba-9edd43dcd6cc040416f11e00320c53682558fd8a.tar.gz
fixed another potential fork bomb where the wins file becomes
non-writeable for some reason.
-rw-r--r--source/nmbd/nmbd_synclists.c2
-rw-r--r--source/nmbd/nmbd_winsserver.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/source/nmbd/nmbd_synclists.c b/source/nmbd/nmbd_synclists.c
index 432b6dcbe29..dee64d501b2 100644
--- a/source/nmbd/nmbd_synclists.c
+++ b/source/nmbd/nmbd_synclists.c
@@ -234,6 +234,8 @@ static void complete_sync(struct sync_record *s)
int count=0;
f = fopen(s->fname,"r");
+
+ if (!f) return;
while (!feof(f)) {
diff --git a/source/nmbd/nmbd_winsserver.c b/source/nmbd/nmbd_winsserver.c
index 64f31429726..72386bd55ba 100644
--- a/source/nmbd/nmbd_winsserver.c
+++ b/source/nmbd/nmbd_winsserver.c
@@ -1569,6 +1569,9 @@ void wins_write_database(BOOL background)
if((fp = fopen(fnamenew,"w")) == NULL)
{
DEBUG(0,("wins_write_database: Can't open %s. Error was %s\n", fnamenew, strerror(errno)));
+ if (background) {
+ _exit(0);
+ }
return;
}