diff options
author | Fabiano Fidêncio <fidencio@redhat.com> | 2017-08-02 12:10:10 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2017-08-28 20:40:43 +0200 |
commit | 5b93634c7f0e34f69b4cf8fb9b2e77b9179024a7 (patch) | |
tree | 0587d1c30c467b7283bd6639be58c451550b4a6a /src/tests | |
parent | 7c1d1393537dec95e09b83b607ce9d0e8f49584c (diff) | |
download | sssd-5b93634c7f0e34f69b4cf8fb9b2e77b9179024a7.tar.gz sssd-5b93634c7f0e34f69b4cf8fb9b2e77b9179024a7.tar.xz sssd-5b93634c7f0e34f69b4cf8fb9b2e77b9179024a7.zip |
UTIL: move {files,selinux}.c under util directory
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 <fidencio@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/files-tests.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c index e96a60af1..9feb9274a 100644 --- a/src/tests/files-tests.c +++ b/src/tests/files-tests.c @@ -32,7 +32,6 @@ #include <popt.h> #include "config.h" -#include "tools/tools_util.h" #include "util/util.h" #include "tests/common.h" @@ -144,7 +143,7 @@ START_TEST(test_remove_tree) fail_if(ret == -1, "Cannot chdir\n"); /* and finally wipe it out.. */ - ret = remove_tree(dir_path); + ret = sss_remove_tree(dir_path); fail_unless(ret == EOK, "remove_tree failed\n"); /* check if really gone */ @@ -193,7 +192,7 @@ START_TEST(test_remove_subtree) fail_if(ret == -1, "Cannot chdir\n"); /* and finally wipe it out.. */ - ret = remove_subtree(dir_path); + ret = sss_remove_subtree(dir_path); fail_unless(ret == EOK, "remove_subtree failed\n"); /* check if really gone */ @@ -240,7 +239,7 @@ START_TEST(test_simple_copy) /* and finally copy.. */ DEBUG(SSSDBG_FUNC_DATA, "Will copy from '%s' to '%s'\n", dir_path, dst_path); - ret = copy_tree(dir_path, dst_path, 0700, uid, gid); + ret = sss_copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); /* check if really copied */ @@ -284,7 +283,7 @@ START_TEST(test_copy_file) /* Copy this file to a new file */ DEBUG(SSSDBG_FUNC_DATA, "Will copy from 'foo' to 'bar'\n"); - ret = copy_file_secure(foo_path, bar_path, 0700, uid, gid, 0); + ret = sss_copy_file_secure(foo_path, bar_path, 0700, uid, gid, 0); fail_unless(ret == EOK, "copy_file_secure failed\n"); /* check if really copied */ @@ -326,7 +325,7 @@ START_TEST(test_copy_symlink) /* and finally copy.. */ DEBUG(SSSDBG_FUNC_DATA, "Will copy from '%s' to '%s'\n", dir_path, dst_path); - ret = copy_tree(dir_path, dst_path, 0700, uid, gid); + ret = sss_copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); /* check if really copied */ @@ -365,7 +364,7 @@ START_TEST(test_copy_node) /* and finally copy.. */ DEBUG(SSSDBG_FUNC_DATA, "Will copy from '%s' to '%s'\n", dir_path, dst_path); - ret = copy_tree(dir_path, dst_path, 0700, uid, gid); + ret = sss_copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); /* check if really copied and without special files */ |