summaryrefslogtreecommitdiff
path: root/source4/param/util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-01-24 02:48:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:18 -0500
commitd5bbd817fe83aed1ee48ed4f478f3887c059f7b9 (patch)
treef4373e5c069d1b6f1cbc489d3e5addc8dd8e6a19 /source4/param/util.c
parent14503a65ec81ae15a05633b0aea6e62e35b021f3 (diff)
downloadsamba-d5bbd817fe83aed1ee48ed4f478f3887c059f7b9.tar.gz
samba-d5bbd817fe83aed1ee48ed4f478f3887c059f7b9.tar.bz2
samba-d5bbd817fe83aed1ee48ed4f478f3887c059f7b9.zip
r20988: Call out to Heimdal's krb5.conf processing to configure many aspects
of KDC behaviour. This should allow PKINIT to be turned on and managed with reasonable sanity. This also means that the krb5.conf in the same directory as the smb.conf will always have priority in Samba4, which I think will be useful. Andrew Bartlett (This used to be commit a50bbde81b010bc5d06e3fc3417ade44627eb771)
Diffstat (limited to 'source4/param/util.c')
-rw-r--r--source4/param/util.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/param/util.c b/source4/param/util.c
index 2453094798..82f57a605b 100644
--- a/source4/param/util.c
+++ b/source4/param/util.c
@@ -123,6 +123,28 @@ _PUBLIC_ char *data_path(TALLOC_CTX* mem_ctx, const char *name)
}
/**
+ * @brief Returns an absolute path to a file in the directory containing the current config file
+ *
+ * @param name File to find, relative to the config file directory.
+ *
+ * @retval Pointer to a talloc'ed string containing the full path.
+ **/
+
+_PUBLIC_ char *config_path(TALLOC_CTX* mem_ctx, const char *name)
+{
+ char *fname, *config_dir, *p;
+ config_dir = talloc_strdup(mem_ctx, lp_configfile());
+ p = strrchr(config_dir, '/');
+ if (!p) {
+ return NULL;
+ }
+ p[0] = '\0';
+ fname = talloc_asprintf(mem_ctx, "%s/%s", config_dir, name);
+ talloc_free(config_dir);
+ return fname;
+}
+
+/**
* @brief Returns an absolute path to a file in the Samba private directory.
*
* @param name File to find, relative to PRIVATEDIR.