svn commit: samba r12285 - in branches/SAMBA_4_0/source/lib: .

metze at samba.org metze at samba.org
Fri Dec 16 11:54:06 GMT 2005


Author: metze
Date: 2005-12-16 11:54:05 +0000 (Fri, 16 Dec 2005)
New Revision: 12285

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12285

Log:
move the smbd.tmp into piddir, --with-fhs piddir is different
from lockdir and they are typically set to piddir=/var/run/samba
and lockdir=/var/lib/samba, and we should keep the temporary stuff
under /var/run/samba

metze
Modified:
   branches/SAMBA_4_0/source/lib/util.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util.c	2005-12-16 10:21:05 UTC (rev 12284)
+++ branches/SAMBA_4_0/source/lib/util.c	2005-12-16 11:54:05 UTC (rev 12285)
@@ -625,6 +625,29 @@
 	return fname;
 }
 
+
+/*****************************************************************
+ A useful function for returning a path in the Samba piddir directory.
+*****************************************************************/  
+char *pid_path(TALLOC_CTX* mem_ctx, const char *name)
+{
+	char *fname, *dname;
+
+	dname = talloc_strdup(mem_ctx, lp_piddir());
+	trim_string(dname,"","/");
+	
+	if (!directory_exist(dname)) {
+		mkdir(dname,0755);
+	}
+	
+	fname = talloc_asprintf(mem_ctx, "%s/%s", dname, name);
+
+	talloc_free(dname);
+
+	return fname;
+}
+
+
 /**
  * @brief Returns an absolute path to a file in the Samba lib directory.
  *
@@ -670,7 +693,7 @@
 {
 	char *fname, *dname;
 
-	dname = lock_path(mem_ctx, "smbd.tmp");
+	dname = pid_path(mem_ctx, "smbd.tmp");
 	if (!directory_exist(dname)) {
 		mkdir(dname,0755);
 	}



More information about the samba-cvs mailing list