$NetBSD$

--- nmbd/nmbd.c.orig	2010-01-14 10:12:10.000000000 +0000
+++ nmbd/nmbd.c
@@ -909,6 +909,10 @@ static bool open_sockets(bool isdaemon, 
 		mkdir(lp_lockdir(), 0755);
 	}
 
+	if (!directory_exist(lp_statedir(), NULL)) {
+		mkdir(lp_statedir(), 0755);
+	}
+
 	pidfile_create("nmbd");
 
 	if (!reinit_after_fork(nmbd_messaging_context(),
