[Pkg-samba-maint] r1537 - in branches/samba/experimental/debian: . patches
vorlon at alioth.debian.org
vorlon at alioth.debian.org
Sun Oct 21 05:09:16 UTC 2007
Author: vorlon
Date: 2007-10-21 05:09:16 +0000 (Sun, 21 Oct 2007)
New Revision: 1537
Modified:
branches/samba/experimental/debian/changelog
branches/samba/experimental/debian/patches/fhs-filespaths-debatable.patch
branches/samba/experimental/debian/patches/fhs-newpaths.patch
Log:
Use talloc_strdup() and talloc_asprintf() instead of static strings in
data_path(), state_path and cache_path(), as suggested by Volker Lendecke.
Modified: branches/samba/experimental/debian/changelog
===================================================================
--- branches/samba/experimental/debian/changelog 2007-10-21 04:59:46 UTC (rev 1536)
+++ branches/samba/experimental/debian/changelog 2007-10-21 05:09:16 UTC (rev 1537)
@@ -8,6 +8,9 @@
feature is not activated by default.
* Update smbstatus-locking.patch to use db_open() instead of
tdb_open(), per upstream recommendation.
+ * Use talloc_strdup() and talloc_asprintf() instead of static strings in
+ data_path(), state_path(), and cache_path(), as suggested by Volker
+ Lendecke.
[ Debconf translations ]
* Hebrew added. Closes: #444054
@@ -19,8 +22,11 @@
- fhs-filespaths.patch: assign files to new paths
- fhs-assignpaths.patch: assign paths to FHS-compatible locations
- -- Steve Langasek <vorlon at debian.org> Sat, 20 Oct 2007 17:34:08 -0700
+ [ Steve Langasek ]
+ *
+ -- Steve Langasek <vorlon at debian.org> Sat, 20 Oct 2007 22:08:08 -0700
+
samba (3.0.26a-1) unstable; urgency=low
* New upstream release.
Modified: branches/samba/experimental/debian/patches/fhs-filespaths-debatable.patch
===================================================================
--- branches/samba/experimental/debian/patches/fhs-filespaths-debatable.patch 2007-10-21 04:59:46 UTC (rev 1536)
+++ branches/samba/experimental/debian/patches/fhs-filespaths-debatable.patch 2007-10-21 05:09:16 UTC (rev 1537)
@@ -50,8 +50,8 @@
===================================================================
--- samba-3.2.0pre1.orig/source/lib/util.c
+++ samba-3.2.0pre1/source/lib/util.c
-@@ -2689,6 +2689,27 @@
- return fname;
+@@ -2687,6 +2687,27 @@
+ return talloc_strdup(talloc_tos(), fname);
}
+
@@ -60,19 +60,19 @@
+ *****************************************************************/
+char *cache_path(char *name)
+{
-+ static pstring fname;
++ pstring fname;
+
+ pstrcpy(fname,dyn_CACHEDIR());
+ trim_string(fname,"","/");
+
+ if (!directory_exist(fname,NULL)) {
-+ mkdir(fname,0755);
++ mkdir(fname,0755);
+ }
+
+ pstrcat(fname,"/");
+ pstrcat(fname,name);
+
-+ return fname;
++ return talloc_strdup(talloc_tos(), fname);
+}
+
/**
Modified: branches/samba/experimental/debian/patches/fhs-newpaths.patch
===================================================================
--- branches/samba/experimental/debian/patches/fhs-newpaths.patch 2007-10-21 04:59:46 UTC (rev 1536)
+++ branches/samba/experimental/debian/patches/fhs-newpaths.patch 2007-10-21 05:09:16 UTC (rev 1537)
@@ -141,11 +141,11 @@
+
+char *dyn_STATEDIR(void);
+char *dyn_CACHEDIR(void);
-Index: samba-3.0.26a/source/lib/util.c
+Index: samba-3.2.0pre1/source/lib/util.c
===================================================================
---- samba-3.0.26a.orig/source/lib/util.c
-+++ samba-3.0.26a/source/lib/util.c
-@@ -2632,6 +2632,41 @@
+--- samba-3.2.0pre1.orig/source/lib/util.c
++++ samba-3.2.0pre1/source/lib/util.c
+@@ -2655,6 +2655,39 @@
}
/**
@@ -153,14 +153,12 @@
+ *
+ * @param name File to find, relative to CODEPAGEDIR.
+ *
-+ * @retval Pointer to a static #pstring containing the full path.
++ * @retval Pointer to a talloc'ed string containing the full path.
+ **/
+
+char *data_path(const char *name)
+{
-+ static pstring fname;
-+ snprintf(fname, sizeof(fname), "%s/%s", dyn_CODEPAGEDIR, name);
-+ return fname;
++ return talloc_asprintf(talloc_tos(), "%s/%s", dyn_CODEPAGEDIR, name);
+}
+
+/*****************************************************************
@@ -168,7 +166,7 @@
+ *****************************************************************/
+char *state_path(char *name)
+{
-+ static pstring fname;
++ pstring fname;
+
+ pstrcpy(fname,dyn_STATEDIR());
+ trim_string(fname,"","/");
@@ -180,7 +178,7 @@
+ pstrcat(fname,"/");
+ pstrcat(fname,name);
+
-+ return fname;
++ return talloc_strdup(talloc_tos(), fname);
+}
+
+/**
More information about the Pkg-samba-maint
mailing list