From 5b93634c7f0e34f69b4cf8fb9b2e77b9179024a7 Mon Sep 17 00:00:00 2001 From: Fabiano Fidêncio Date: Wed, 2 Aug 2017 12:10:10 +0200 Subject: UTIL: move {files,selinux}.c under util directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit files.c has at least one function that will be re-used for the new session provider that's about to be added. Also, a few other functions may be added and files.c seems the right place for those. selinux.c has been moved together with files.c as the latter takes advantage of some functions from the former and we do not want to always link agains the tools code. The public functions from files.c got a "sss_" prefix and it has been changed whenever they're used. Last but not least, all the places that included "tools/tools_util.h" due to the functions on files.c had this include removed (as they were already including "util/util.h". Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio Reviewed-by: Pavel Březina Reviewed-by: Jakub Hrozek --- src/tools/tools_util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/tools/tools_util.c') diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c index 5e51a4089..87a17491d 100644 --- a/src/tools/tools_util.c +++ b/src/tools/tools_util.c @@ -33,7 +33,6 @@ #include "util/util.h" #include "confdb/confdb.h" #include "db/sysdb.h" -#include "tools/tools_util.h" #include "tools/sss_sync_ops.h" static int setup_db(struct tools_ctx *ctx) @@ -414,7 +413,7 @@ int remove_homedir(TALLOC_CTX *mem_ctx, } /* Remove the tree */ - ret = remove_tree(homedir); + ret = sss_remove_tree(homedir); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Cannot remove homedir %s: %d\n", homedir, ret); @@ -502,7 +501,7 @@ int create_homedir(const char *skeldir, selinux_file_context(homedir); - ret = copy_tree(skeldir, homedir, 0777 & ~default_umask, uid, gid); + ret = sss_copy_tree(skeldir, homedir, 0777 & ~default_umask, uid, gid); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Cannot populate user's home directory: [%d][%s].\n", -- cgit