Avoid including libds/common/roles.h in public loadparm.h header.
[sfrench/samba-autobuild/.git] / lib / param / util.c
index 232e85b75c1786a7a02053b76755dd3647f7518d..bf9e0b8c309dfe39525e66be38130bca42fc574a 100644 (file)
@@ -28,6 +28,7 @@
 #include "system/filesys.h"
 #include "system/dir.h"
 #include "param/param.h"
+#include "libds/common/roles.h"
 
 /**
  * @file
@@ -91,7 +92,7 @@ static char *lpcfg_common_path(TALLOC_CTX* mem_ctx,
        }
        trim_string(dname,"","/");
 
-       ok = directory_create_or_exist(dname, geteuid(), 0755);
+       ok = directory_create_or_exist(dname, 0755);
        if (!ok) {
                DEBUG(1, ("Unable to create directory %s for file %s. "
                          "Error was %s\n", dname, name, strerror(errno)));
@@ -193,9 +194,7 @@ char *lpcfg_private_path(TALLOC_CTX* mem_ctx,
  * @brief Returns an absolute path to a NTDB or TDB file in the Samba
  * private directory.
  *
- * @param name File to find, relative to PRIVATEDIR, without .(n)tdb extension.
- * Only provide fixed-string names which are supposed to change with "use ntdb"
- * option.
+ * @param name File to find, relative to PRIVATEDIR, without .tdb extension.
  *
  * @retval Pointer to a talloc'ed string containing the full path, for
  * use with dbwrap_local_open().
@@ -204,14 +203,8 @@ char *lpcfg_private_db_path(TALLOC_CTX *mem_ctx,
                            struct loadparm_context *lp_ctx,
                            const char *name)
 {
-       const char *extension = ".tdb";
-
-       if (lpcfg_use_ntdb(lp_ctx)) {
-               extension = ".ntdb";
-       }
-
-       return talloc_asprintf(mem_ctx, "%s/%s%s",
-                              lpcfg_private_dir(lp_ctx), name, extension);
+       return talloc_asprintf(mem_ctx, "%s/%s.tdb",
+                              lpcfg_private_dir(lp_ctx), name);
 }
 
 /**
@@ -231,7 +224,7 @@ char *smbd_tmp_path(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       ok = directory_create_or_exist(dname, geteuid(), 0755);
+       ok = directory_create_or_exist(dname, 0755);
        if (!ok) {
                return NULL;
        }