diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-22 09:47:41 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-25 09:03:29 -0400 |
commit | 8263230a0c543a737ab17a071a0ea964dcab4259 (patch) | |
tree | 373caef346d1b73f3dcf6d0d168402f3eecc4d23 /server/tools | |
parent | c65b34ae1d5794fc4456a25705163f56283047d2 (diff) | |
download | sssd-8263230a0c543a737ab17a071a0ea964dcab4259.tar.gz sssd-8263230a0c543a737ab17a071a0ea964dcab4259.tar.xz sssd-8263230a0c543a737ab17a071a0ea964dcab4259.zip |
Upgrade confdb to version 2
This converts a great many configuration options to the new
standard format.
Diffstat (limited to 'server/tools')
-rw-r--r-- | server/tools/sss_sync_ops.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/server/tools/sss_sync_ops.c b/server/tools/sss_sync_ops.c index d9db2304c..50eb197e1 100644 --- a/server/tools/sss_sync_ops.c +++ b/server/tools/sss_sync_ops.c @@ -27,11 +27,6 @@ #include "tools/sss_sync_ops.h" /* Default settings for user attributes */ -#define CONFDB_DFL_SECTION "config/user_defaults" - -#define DFL_SHELL_ATTR "defaultShell" -#define DFL_BASEDIR_ATTR "baseDirectory" - #define DFL_SHELL_VAL "/bin/bash" #define DFL_BASEDIR_VAL "/home" @@ -1129,17 +1124,24 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, int ret; char *basedir = NULL; char *dfl_shell = NULL; + char *conf_path = NULL; + + conf_path = talloc_asprintf(mem_ctx, CONFDB_DOMAIN_PATH_TMPL, data->domain->name); + if (!conf_path) { + return ENOMEM; + } data->gecos = talloc_strdup(mem_ctx, gecos ? gecos : data->name); if (!data->gecos) { - return ENOMEM; + ret = ENOMEM; + goto done; } if (homedir) { data->home = talloc_strdup(data, homedir); } else { ret = confdb_get_string(confdb, mem_ctx, - CONFDB_DFL_SECTION, DFL_BASEDIR_ATTR, + conf_path, CONFDB_LOCAL_DEFAULT_BASEDIR, DFL_BASEDIR_VAL, &basedir); if (ret != EOK) { goto done; @@ -1157,7 +1159,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, if (!shell) { ret = confdb_get_string(confdb, mem_ctx, - CONFDB_DFL_SECTION, DFL_SHELL_ATTR, + conf_path, CONFDB_LOCAL_DEFAULT_SHELL, DFL_SHELL_VAL, &dfl_shell); if (ret != EOK) { goto done; @@ -1174,6 +1176,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, done: talloc_free(dfl_shell); talloc_free(basedir); + talloc_free(conf_path); return ret; } |