$NetBSD: patch-ap,v 1.2 2013/08/12 02:47:32 taca Exp $

--- nmbd/nmbd.c.orig	2013-07-24 18:53:49.000000000 +0000
+++ nmbd/nmbd.c
@@ -917,6 +917,10 @@ static bool open_sockets(bool isdaemon, 
 		mkdir(lp_lockdir(), 0755);
 	}
 
+	if (!directory_exist(lp_statedir())) {
+		mkdir(lp_statedir(), 0755);
+	}
+
 	pidfile_create("nmbd");
 
 	if (!NT_STATUS_IS_OK(reinit_after_fork(nmbd_messaging_context(),
