diff options
author | Ondrej Kos <okos@redhat.com> | 2013-07-09 23:38:42 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-07-10 16:46:11 +0200 |
commit | aed8c0cae4f53926b4c34bb41e47103367c2815b (patch) | |
tree | e20022e5b3e8862c80d4ed3482ddd53518e32005 /src/tests | |
parent | f7b2ea56bd1af9c7b48cc3e17c5e48a2eb64963d (diff) | |
download | sssd-aed8c0cae4f53926b4c34bb41e47103367c2815b.tar.gz sssd-aed8c0cae4f53926b4c34bb41e47103367c2815b.tar.xz sssd-aed8c0cae4f53926b4c34bb41e47103367c2815b.zip |
Do not copy special files when creating homedir
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/files-tests.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c index 4225098c2..5851a721f 100644 --- a/src/tests/files-tests.c +++ b/src/tests/files-tests.c @@ -245,7 +245,6 @@ START_TEST(test_copy_node) int ret; char origpath[PATH_MAX+1]; char *tmp; - struct stat statbuf; errno = 0; fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); @@ -267,14 +266,13 @@ START_TEST(test_copy_node) ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); - /* check if really copied */ + /* check if really copied and without special files */ ret = access(dst_path, F_OK); fail_unless(ret == 0, "destination directory not there\n"); tmp = talloc_asprintf(test_ctx, "%s/testnode", dst_path); - ret = lstat(tmp, &statbuf); - fail_unless(ret == 0, "cannot stat the node %s\n", tmp); - fail_unless(S_ISFIFO(statbuf.st_mode), "%s not a char device??\n", tmp); + ret = access(tmp, F_OK); + fail_unless(ret == -1, "special file %s exists, it shouldn't\n", tmp); talloc_free(tmp); } END_TEST |