blob: 92f521b675e703e660106fe7ce2cf08b336f1bba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$NetBSD: patch-br,v 1.1.1.1 2011/12/15 22:23:24 asau Exp $
--- lib/util.c.orig 2008-03-08 10:33:34.000000000 -0500
+++ lib/util.c
@@ -2598,6 +2598,26 @@ char *lock_path(const char *name)
}
/*****************************************************************
+ A useful function for returning a path in the Samba state directory.
+*****************************************************************/
+
+char *state_path(const char *name)
+{
+ static pstring fname;
+
+ pstrcpy(fname,lp_statedir());
+ trim_char(fname,'\0','/');
+
+ if (!directory_exist(fname,NULL))
+ mkdir(fname,0755);
+
+ pstrcat(fname,"/");
+ pstrcat(fname,name);
+
+ return fname;
+}
+
+/*****************************************************************
A useful function for returning a path in the Samba pid directory.
*****************************************************************/
|