[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Dec 14 23:08:02 UTC 2015


The branch, master has been updated
       via  203f023 s4:torture/winbind: add more debug output to samba4.winbind.struct.domain_info
       via  79f946c lib: Remove unused talloc_append_blob
       via  8ca3a58 gencache: Refactor gencache_set_data_blob
       via  640870e lib: Separate out xx_path() & callers
       via  c281573 lib: Use directory_create_or_exist in xx_path
       via  d547d03 gencache: True->true, False->false
       via  5ef9184 lib: Add gencache.h
      from  f3d140f docs-xml: Update idmap_rfc2307 manpage for new realm handling

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 203f0233827e620eb89d68f7e9d2a72e0fbecafd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 11 08:52:59 2015 +0100

    s4:torture/winbind: add more debug output to samba4.winbind.struct.domain_info
    
    With this we hopefully find the reason for the following flakey test:
    
      [1566(10157)/1882 at 1h47m18s] samba4.winbind.struct(ad_member:local)
      Running WINBINDD_DOMAIN_INFO (struct based)
      DOMAIN 'BUILTIN' => '' [ ] [S-1-5-32]
      DOMAIN 'LOCALADMEMBER' => '' [ ] [S-1-5-21-4121020324-2900821022-46155812]
      DOMAIN 'SAMBADOMAIN' => 'samba.example.com' [ PR AD NA ] [S-1-5-21-929009974-669086582-3038401809]
      DOMAIN 'TORTURE300' => 'torturedom300.samba._none_.example.com' [ AD NA ] [S-1-5-21-97398-379795-300]
      DOMAIN 'TORTURE301' => 'torturedom301.samba._none_.example.com' [ AD NA ] [S-1-5-21-97398-379795-301]
      DOMAIN 'TORTURE302' => 'torturedom302.samba._none_.example.com' [ AD NA ] [S-1-5-21-97398-379795-302]
      DOMAIN 'TORTURE303' => 'torturedom303.samba._none_.example.com' [ AD NA ] [S-0-0]
      UNEXPECTED(failure): samba4.winbind.struct.domain_info(ad_member:local)
      REASON: Exception: Exception: ../source4/torture/winbind/struct_based.c:460:
      Expression `ok' failed: SID's doesn't match
    
    With the changes we get:
    
      [1566(10158)/1882 at 1h47m51s] samba4.winbind.struct(ad_member:local)
      Running WINBINDD_DOMAIN_INFO (struct based)
      LIST[0] 'BUILTIN' => '' [S-1-5-32]
      LIST[1] 'LOCALADMEMBER' => '' [S-1-5-21-734569583-677146317-1850798319]
      LIST[2] 'SAMBADOMAIN' => 'samba.example.com' [S-1-5-21-1870621479-3245899124-866531092]
      LIST[3] 'TORTURE300' => 'torturedom300.samba._none_.example.com' [S-1-5-21-97398-379795-300]
      LIST[4] 'TORTURE301' => 'torturedom301.samba._none_.example.com' [S-1-5-21-97398-379795-301]
      LIST[5] 'TORTURE302' => 'torturedom302.samba._none_.example.com' [S-1-5-21-97398-379795-302]
      LIST[6] 'TORTURE303' => 'torturedom303.samba._none_.example.com' [S-1-0-0]
      LIST[7] 'TORTURE304' => 'torturedom304.samba._none_.example.com' [S-1-0-0]
      LIST[8] 'TORTURE305' => 'torturedom305.samba._none_.example.com' [S-1-0-0]
      LIST[9] 'TORTURE306' => 'torturedom306.samba._none_.example.com' [S-1-5-21-97398-379795-306]
      LIST[10] 'TORTURE307' => 'torturedom307.samba._none_.example.com' [S-1-5-21-97398-379795-307]
      LIST[11] 'TORTURE308' => 'torturedom308.samba._none_.example.com' [S-1-5-21-97398-379795-308]
      LIST[12] 'TORTURE309' => 'torturedom309.samba._none_.example.com' [S-1-5-21-97398-379795-309]
      LIST[13] 'TORTURE310' => 'torturedom310.samba._none_.example.com' [S-1-5-21-97398-379795-310]
      LIST[14] 'TORTURE311' => 'torturedom311.samba._none_.example.com' [S-1-5-21-97398-379795-311]
      DOMAIN[0] 'BUILTIN' => '' [ ] [S-1-5-32]
      DOMAIN[1] 'LOCALADMEMBER' => '' [ ] [S-1-5-21-734569583-677146317-1850798319]
      DOMAIN[2] 'SAMBADOMAIN' => 'samba.example.com' [ PR AD NA ] [S-1-5-21-1870621479-3245899124-866531092]
      DOMAIN[3] 'TORTURE300' => 'torturedom300.samba._none_.example.com' [ AD NA ] [S-1-5-21-97398-379795-300]
      DOMAIN[4] 'TORTURE301' => 'torturedom301.samba._none_.example.com' [ AD NA ] [S-1-5-21-97398-379795-301]
      DOMAIN[5] 'TORTURE302' => 'torturedom302.samba._none_.example.com' [ AD NA ] [S-1-5-21-97398-379795-302]
      DOMAIN[6] 'TORTURE303' => 'torturedom303.samba._none_.example.com' [ AD NA ] [S-0-0]
      UNEXPECTED(failure): samba4.winbind.struct.domain_info(ad_member:local)
      REASON: Exception: Exception: ../source4/torture/winbind/struct_based.c:471: Expression `ok' failed: SID's doesn't match [S-1-0-0] != [S-0-0]
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Mon Dec 14 23:26:40 CET 2015 on sn-devel-104

commit 79f946cdb6733ccd616e6add8dab9f759937d6e5
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 13 21:21:47 2015 +0100

    lib: Remove unused talloc_append_blob
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 8ca3a58ec923d9e3f69c2a8971873acedce761d6
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 13 21:16:36 2015 +0100

    gencache: Refactor gencache_set_data_blob
    
    Replace 3 calls into talloc with 1. Add an overflow check.
    
    With this change, it will be easier to avoid the talloc call for small
    blobs in the future and do it on the stack.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 640870ee2089536d2f7bda035668c96e8b364e54
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 13 16:32:52 2015 +0100

    lib: Separate out xx_path() & callers
    
    We should not have to #include proto.h just for cache_path() or so
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c281573399584228e2a1b567a5507f459c94f6ad
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 13 15:27:15 2015 +0100

    lib: Use directory_create_or_exist in xx_path
    
    directory_create_or_exist is a little different: It does the lstat first and
    sets the umask properly, but I think this is more correct than the xx_path()
    version before.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d547d030e0e3a9fb250f9d185f6a304064ab716b
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 13 15:17:27 2015 +0100

    gencache: True->true, False->false
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 5ef91849645d6c1fa8eadee08c77ebfc03c7a71b
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 13 15:14:18 2015 +0100

    lib: Add gencache.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/include/proto.h                    | 26 +-------
 source3/lib/gencache.c                     | 42 ++++++++-----
 source3/lib/gencache.h                     | 53 ++++++++++++++++
 source3/lib/util.c                         | 98 ------------------------------
 source3/lib/util_path.c                    | 95 +++++++++++++++++++++++++++++
 source3/lib/{util_procid.h => util_path.h} | 16 ++---
 source3/wscript_build                      |  1 +
 source4/torture/winbind/struct_based.c     | 15 ++++-
 8 files changed, 196 insertions(+), 150 deletions(-)
 create mode 100644 source3/lib/gencache.h
 create mode 100644 source3/lib/util_path.c
 copy source3/lib/{util_procid.h => util_path.h} (71%)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 7d0ba42..4cd69fd 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -88,26 +88,7 @@ int map_errno_from_nt_status(NTSTATUS status);
 
 struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_STAT *sbuf);
 
-/* The following definitions come from lib/gencache.c  */
-
-bool gencache_set(const char *keystr, const char *value, time_t timeout);
-bool gencache_del(const char *keystr);
-bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
-		  time_t *ptimeout);
-bool gencache_parse(const char *keystr,
-		    void (*parser)(time_t timeout, DATA_BLOB blob,
-				   void *private_data),
-		    void *private_data);
-bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
-			    DATA_BLOB *blob,
-			    time_t *timeout, bool *was_expired);
-bool gencache_stabilize(void);
-bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout);
-void gencache_iterate_blobs(void (*fn)(const char *key, DATA_BLOB value,
-				       time_t timeout, void *private_data),
-			    void *private_data, const char *pattern);
-void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr),
-                      void* data, const char* keystr_pattern);
+#include "lib/gencache.h"
 
 /* The following definitions come from lib/interface.c  */
 
@@ -419,9 +400,7 @@ int smb_mkstemp(char *name_template);
 void *smb_xmalloc_array(size_t size, unsigned int count);
 char *myhostname(void);
 char *myhostname_upper(void);
-char *lock_path(const char *name);
-char *state_path(const char *name);
-char *cache_path(const char *name);
+#include "lib/util_path.h"
 bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
 		    const char **name);
 bool ms_has_wild(const char *s);
@@ -431,7 +410,6 @@ bool mask_match_search(const char *string, const char *pattern, bool is_case_sen
 bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive);
 bool unix_wild_match(const char *pattern, const char *string);
 bool name_to_fqdn(fstring fqdn, const char *name);
-void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob);
 uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options);
 
 #include "lib/util_procid.h"
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 90eafaa..ed16d79 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -63,7 +63,9 @@ static bool gencache_init(void)
 	int open_flags = O_RDWR|O_CREAT;
 
 	/* skip file open if it's already opened */
-	if (cache) return True;
+	if (cache) {
+		return true;
+	}
 
 	cache_fname = cache_path("gencache.tdb");
 	if (cache_fname == NULL) {
@@ -112,7 +114,7 @@ static bool gencache_init(void)
 
 	if (!cache) {
 		DEBUG(5, ("Attempt to open gencache.tdb has failed.\n"));
-		return False;
+		return false;
 	}
 
 	cache_fname = lock_path("gencache_notrans.tdb");
@@ -139,7 +141,7 @@ static bool gencache_init(void)
 	}
 	TALLOC_FREE(cache_fname);
 
-	return True;
+	return true;
 }
 
 static TDB_DATA last_stabilize_key(void)
@@ -281,6 +283,8 @@ bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
 			    time_t timeout)
 {
 	int ret;
+	fstring hdr;
+	int hdr_len;
 	char* val;
 	time_t last_stabilize;
 	static int writecount;
@@ -295,7 +299,9 @@ bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
 		return false;
 	}
 
-	if (!gencache_init()) return False;
+	if (!gencache_init()) {
+		return false;
+	}
 
 	if (gencache_have_val(keystr, blob, timeout)) {
 		DEBUG(10, ("Did not store value for %s, we already got it\n",
@@ -303,19 +309,23 @@ bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
 		return true;
 	}
 
-	val = talloc_asprintf(talloc_tos(), CACHE_DATA_FMT, (int)timeout);
-	if (val == NULL) {
-		return False;
+	hdr_len = fstr_sprintf(hdr, CACHE_DATA_FMT, (int)timeout);
+
+	if (hdr_len == -1) {
+		return false;
 	}
-	val = talloc_realloc(NULL, val, char, talloc_array_length(val)-1);
-	if (val == NULL) {
+	if ((blob->length + (size_t)hdr_len) < blob->length) {
 		return false;
 	}
-	val = (char *)talloc_append_blob(NULL, val, *blob);
+
+	val = talloc_array(talloc_tos(), char, hdr_len + blob->length);
 	if (val == NULL) {
 		return false;
 	}
 
+	memcpy(val, hdr, hdr_len);
+	memcpy(val+hdr_len, blob->data, blob->length);
+
 	DEBUG(10, ("Adding cache entry with key=[%s] and timeout="
 	           "[%s] (%d seconds %s)\n", keystr,
 		   timestring(talloc_tos(), timeout),
@@ -383,7 +393,9 @@ bool gencache_del(const char *keystr)
 		return false;
 	}
 
-	if (!gencache_init()) return False;	
+	if (!gencache_init()) {
+		return false;
+	}
 
 	DEBUG(10, ("Deleting cache entry (key=[%s])\n", keystr));
 
@@ -569,7 +581,7 @@ static void gencache_get_data_blob_parser(time_t timeout, DATA_BLOB blob,
  *        timeout
  *
  * @retval true when entry is successfuly fetched
- * @retval False for failure
+ * @retval false for failure
  **/
 
 bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
@@ -604,7 +616,7 @@ bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
 		*timeout = state.timeout;
 	}
 
-	return True;
+	return true;
 
 fail:
 	if (was_expired != NULL) {
@@ -793,14 +805,14 @@ static int wipe_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val,
  *        timeout
  *
  * @retval true when entry is successfuly fetched
- * @retval False for failure
+ * @retval false for failure
  **/
 
 bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
 		  time_t *ptimeout)
 {
 	DATA_BLOB blob;
-	bool ret = False;
+	bool ret = false;
 
 	ret = gencache_get_data_blob(keystr, mem_ctx, &blob, ptimeout, NULL);
 	if (!ret) {
diff --git a/source3/lib/gencache.h b/source3/lib/gencache.h
new file mode 100644
index 0000000..61716c4
--- /dev/null
+++ b/source3/lib/gencache.h
@@ -0,0 +1,53 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * Generic, persistent and shared between processes cache mechanism for use
+ * by various parts of the Samba code
+ *
+ * Copyright (C) Rafal Szczesniak    2002
+ * Copyright (C) Volker Lendecke     2009
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LIB_GENCACHE_H__
+#define __LIB_GENCACHE_H__
+
+#include "replace.h"
+#include "system/time.h"
+#include "lib/util/data_blob.h"
+#include "libcli/util/ntstatus.h"
+
+bool gencache_set(const char *keystr, const char *value, time_t timeout);
+bool gencache_del(const char *keystr);
+bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
+		  time_t *ptimeout);
+bool gencache_parse(const char *keystr,
+		    void (*parser)(time_t timeout, DATA_BLOB blob,
+				   void *private_data),
+		    void *private_data);
+bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
+			    DATA_BLOB *blob,
+			    time_t *timeout, bool *was_expired);
+bool gencache_stabilize(void);
+bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
+			    time_t timeout);
+void gencache_iterate_blobs(void (*fn)(const char *key, DATA_BLOB value,
+				       time_t timeout, void *private_data),
+			    void *private_data, const char *pattern);
+void gencache_iterate(void (*fn)(const char* key, const char *value,
+				 time_t timeout, void* dptr),
+                      void* data, const char* keystr_pattern);
+
+#endif
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 1d04318..2895c14 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1496,78 +1496,6 @@ char *myhostname_upper(void)
 	return ret;
 }
 
-/**
- * @brief Returns an absolute path to a file concatenating the provided
- * @a rootpath and @a basename
- *
- * @param name Filename, relative to @a rootpath
- *
- * @retval Pointer to a string containing the full path.
- **/
-
-static char *xx_path(const char *name, const char *rootpath)
-{
-	char *fname = NULL;
-
-	fname = talloc_strdup(talloc_tos(), rootpath);
-	if (!fname) {
-		return NULL;
-	}
-	trim_string(fname,"","/");
-
-	if (!directory_exist(fname)) {
-		if (mkdir(fname,0755) == -1) {
-			/* Did someone else win the race ? */
-			if (errno != EEXIST) {
-				DEBUG(1, ("Unable to create directory %s for file %s. "
-					"Error was %s\n", fname, name, strerror(errno)));
-				return NULL;
-			}
-		}
-	}
-
-	return talloc_asprintf_append(fname, "/%s", name);
-}
-
-/**
- * @brief Returns an absolute path to a file in the Samba lock directory.
- *
- * @param name File to find, relative to LOCKDIR.
- *
- * @retval Pointer to a talloc'ed string containing the full path.
- **/
-
-char *lock_path(const char *name)
-{
-	return xx_path(name, lp_lock_directory());
-}
-
-/**
- * @brief Returns an absolute path to a file in the Samba state directory.
- *
- * @param name File to find, relative to STATEDIR.
- *
- * @retval Pointer to a talloc'ed string containing the full path.
- **/
-
-char *state_path(const char *name)
-{
-	return xx_path(name, lp_state_directory());
-}
-
-/**
- * @brief Returns an absolute path to a file in the Samba cache directory.
- *
- * @param name File to find, relative to CACHEDIR.
- *
- * @retval Pointer to a talloc'ed string containing the full path.
- **/
-
-char *cache_path(const char *name)
-{
-	return xx_path(name, lp_cache_directory());
-}
-
 /*******************************************************************
  Given a filename - get its directory name
 ********************************************************************/
@@ -1890,32 +1818,6 @@ bool name_to_fqdn(fstring fqdn, const char *name)
 	return true;
 }
 
-/**********************************************************************
- Append a DATA_BLOB to a talloc'ed object
-***********************************************************************/
-
-void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob)
-{
-	size_t old_size = 0;
-	char *result;
-
-	if (blob.length == 0) {
-		return buf;
-	}
-
-	if (buf != NULL) {
-		old_size = talloc_get_size(buf);
-	}
-
-	result = (char *)TALLOC_REALLOC(mem_ctx, buf, old_size + blob.length);
-	if (result == NULL) {
-		return NULL;
-	}
-
-	memcpy(result + old_size, blob.data, blob.length);
-	return result;
-}
-
 uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options)
 {
 	switch (share_access & ~FILE_SHARE_DELETE) {
diff --git a/source3/lib/util_path.c b/source3/lib/util_path.c
new file mode 100644
index 0000000..509ba5f
--- /dev/null
+++ b/source3/lib/util_path.c
@@ -0,0 +1,95 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * Samba utility functions
+ * Copyright (C) Andrew Tridgell 1992-1998
+ * Copyright (C) Jeremy Allison 2001-2007
+ * Copyright (C) Simo Sorce 2001
+ * Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2003
+ * Copyright (C) James Peach 2006
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "replace.h"
+#include <talloc.h>
+#include "lib/util/samba_util.h"
+#include "lib/util_path.h"
+
+struct share_params;
+#include "source3/param/param_proto.h"
+
+/**
+ * @brief Returns an absolute path to a file concatenating the provided
+ * @a rootpath and @a basename
+ *
+ * @param name Filename, relative to @a rootpath
+ *
+ * @retval Pointer to a string containing the full path.
+ **/
+
+static char *xx_path(const char *name, const char *rootpath)
+{
+	char *fname = NULL;
+
+	fname = talloc_strdup(talloc_tos(), rootpath);
+	if (!fname) {
+		return NULL;
+	}
+	trim_string(fname,"","/");
+
+	if (!directory_create_or_exist(fname, 0755)) {
+		return NULL;
+	}
+
+	return talloc_asprintf_append(fname, "/%s", name);
+}
+
+/**
+ * @brief Returns an absolute path to a file in the Samba lock directory.
+ *
+ * @param name File to find, relative to LOCKDIR.
+ *
+ * @retval Pointer to a talloc'ed string containing the full path.
+ **/
+
+char *lock_path(const char *name)
+{
+	return xx_path(name, lp_lock_directory());
+}
+
+/**
+ * @brief Returns an absolute path to a file in the Samba state directory.
+ *
+ * @param name File to find, relative to STATEDIR.
+ *
+ * @retval Pointer to a talloc'ed string containing the full path.
+ **/
+
+char *state_path(const char *name)
+{
+	return xx_path(name, lp_state_directory());
+}
+
+/**
+ * @brief Returns an absolute path to a file in the Samba cache directory.
+ *
+ * @param name File to find, relative to CACHEDIR.
+ *
+ * @retval Pointer to a talloc'ed string containing the full path.
+ **/
+
+char *cache_path(const char *name)
+{
+	return xx_path(name, lp_cache_directory());
+}
diff --git a/source3/lib/util_procid.h b/source3/lib/util_path.h
similarity index 71%
copy from source3/lib/util_procid.h
copy to source3/lib/util_path.h
index 9637363..118a4be 100644
--- a/source3/lib/util_procid.h
+++ b/source3/lib/util_path.h
@@ -21,17 +21,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __LIB_UTIL_PROCID_H__
-#define __LIB_UTIL_PROCID_H__
+#ifndef __LIB_UTIL_PATH_H__
+#define __LIB_UTIL_PATH_H__
 
-#include "replace.h"
-#include "librpc/gen_ndr/server_id.h"
-
-pid_t procid_to_pid(const struct server_id *proc);
-void set_my_vnn(uint32_t vnn);
-uint32_t get_my_vnn(void);
-struct server_id pid_to_procid(pid_t pid);
-bool procid_valid(const struct server_id *pid);
-bool procid_is_local(const struct server_id *pid);
+char *lock_path(const char *name);
+char *state_path(const char *name);
+char *cache_path(const char *name);
 
 #endif
diff --git a/source3/wscript_build b/source3/wscript_build
index e66e89f..d40dd7e 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -255,6 +255,7 @@ bld.SAMBA3_SUBSYSTEM('samba3util',
                    lib/util_sid.c
                    lib/util_file.c
                    lib/util.c
+                   lib/util_path.c
                    lib/util_procid.c
                    lib/util_sock.c
                    lib/util_tsock.c
diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c
index a7b6bfd..1a84a7a 100644


-- 
Samba Shared Repository



More information about the samba-cvs mailing list