From 344326675e5267a5834fd755d9643b8b873bef24 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 5 Nov 2009 08:06:02 -0500 Subject: [PATCH 1/4] Build files.c only for tools Move files.c into tools directory --- server/Makefile.am | 6 +++--- server/{util => tools}/files.c | 1 + server/tools/tools_util.h | 10 ++++++++++ server/util/util.h | 10 ---------- 4 files changed, 14 insertions(+), 13 deletions(-) rename server/{util => tools}/files.c (99%) diff --git a/server/Makefile.am b/server/Makefile.am index 81223f4..b26c3cd 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -183,7 +183,6 @@ SSSD_UTIL_OBJ = \ util/backup_file.c \ util/strtonum.c \ util/check_and_open.c \ - util/files.c \ $(SSSD_DEBUG_OBJ) SSSD_RESPONDER_OBJ = \ @@ -194,7 +193,8 @@ SSSD_RESPONDER_OBJ = \ SSSD_TOOLS_OBJ = \ tools/sss_sync_ops.c \ - tools/tools_util.c + tools/tools_util.c \ + tools/files.c SSSD_RESOLV_OBJ = \ resolv/async_resolv.c @@ -432,7 +432,7 @@ files_tests_SOURCES = \ $(SSSD_DEBUG_OBJ) \ tests/files-tests.c \ util/check_and_open.c \ - util/files.c + tools/files.c files_tests_CFLAGS = \ $(AM_CFLAGS) \ $(CHECK_CFLAGS) diff --git a/server/util/files.c b/server/tools/files.c similarity index 99% rename from server/util/files.c rename to server/tools/files.c index ce73fc8..6c64470 100644 --- a/server/util/files.c +++ b/server/tools/files.c @@ -64,6 +64,7 @@ #include "config.h" #include "util/util.h" +#include "tools/tools_util.h" #ifdef HAVE_SELINUX #include diff --git a/server/tools/tools_util.h b/server/tools/tools_util.h index 2a1ee25..a643e73 100644 --- a/server/tools/tools_util.h +++ b/server/tools/tools_util.h @@ -95,4 +95,14 @@ int remove_homedir(TALLOC_CTX *mem_ctx, const char *username, uid_t uid, bool force); +/* from files.c */ +int remove_tree(const char *root); + +int copy_tree(const char *src_root, + const char *dst_root, + uid_t uid, gid_t gid); + +int selinux_file_context(const char *dst_name); +int reset_selinux_file_context(void); + #endif /* __TOOLS_UTIL_H__ */ diff --git a/server/util/util.h b/server/util/util.h index 70dba37..9a27ae5 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -205,14 +205,4 @@ int backup_file(const char *src, int dbglvl); errno_t check_and_open_readonly(const char *filename, int *fd, const uid_t uid, const gid_t gid, const mode_t mode); -/* from files.c */ -int remove_tree(const char *root); - -int copy_tree(const char *src_root, - const char *dst_root, - uid_t uid, gid_t gid); - -int selinux_file_context(const char *dst_name); -int reset_selinux_file_context(void); - #endif /* __SSSD_UTIL_H__ */ -- 1.6.2.5