summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 8f904d486d..d3a63691df 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3213,3 +3213,24 @@ char *myhostname(void)
}
return ret;
}
+
+
+/*****************************************************************
+a useful function for returning a path in the Samba lock directory
+ *****************************************************************/
+char *lock_path(char *name)
+{
+ static pstring fname;
+
+ pstrcpy(fname,lp_lockdir());
+ trim_string(fname,"","/");
+
+ if (!directory_exist(fname,NULL)) {
+ mkdir(fname,0755);
+ }
+
+ pstrcat(fname,"/");
+ pstrcat(fname,name);
+
+ return fname;
+}