Skip to content

Commit 49cb12b

Browse files
committed
sssctl: Use CONFDB_DEFAULT_CONFIG_DIR
Use same logic as the main daemon. Signed-off-by: Samuel Cabrero <scabrero@suse.com>
1 parent 7e5cae0 commit 49cb12b

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

src/tools/sssctl/sssctl_config.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,6 @@
3131
#include "confdb/confdb.h"
3232

3333

34-
35-
static char *sssctl_config_snippet_path(TALLOC_CTX *ctx, const char *path)
36-
{
37-
char *tmp = NULL;
38-
const char delimiter = '/';
39-
char *dpos = NULL;
40-
41-
tmp = talloc_strdup(ctx, path);
42-
if (!tmp) {
43-
return NULL;
44-
}
45-
46-
dpos = strrchr(tmp, delimiter);
47-
if (dpos != NULL) {
48-
++dpos;
49-
*dpos = '\0';
50-
} else {
51-
*tmp = '\0';
52-
}
53-
54-
return talloc_strdup_append(tmp, CONFDB_DEFAULT_CONFIG_DIR_NAME);
55-
}
56-
5734
errno_t sssctl_config_check(struct sss_cmdline *cmdline,
5835
struct sss_tool_ctx *tool_ctx)
5936
{
@@ -97,12 +74,7 @@ errno_t sssctl_config_check(struct sss_cmdline *cmdline,
9774
}
9875

9976
if (config_snippet_path == NULL) {
100-
config_snippet_path = sssctl_config_snippet_path(tmp_ctx, config_path);
101-
if (config_snippet_path == NULL) {
102-
DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create snippet path\n");
103-
ret = ENOMEM;
104-
goto done;
105-
}
77+
config_snippet_path = CONFDB_DEFAULT_CONFIG_DIR;
10678
}
10779

10880
ret = sss_ini_read_sssd_conf(init_data,

0 commit comments

Comments
 (0)