summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorOndrej Kos <okos@redhat.com>2013-06-26 14:56:23 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-07-09 23:47:49 +0200
commiteca766c0801ed859a8b50e23cb94fa79acd866f4 (patch)
tree2e963713fa92877595af46f0ed557d12e5c57421 /src/tests
parent93bd0fbd1147371122612af88ed8a3c4534112ae (diff)
downloadsssd-eca766c0801ed859a8b50e23cb94fa79acd866f4.tar.gz
sssd-eca766c0801ed859a8b50e23cb94fa79acd866f4.tar.bz2
sssd-eca766c0801ed859a8b50e23cb94fa79acd866f4.zip
Do not copy special files when creating homedir
https://fedorahosted.org/sssd/ticket/1778 When trying to copy special file, only message is logged now.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/files-tests.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c
index 4225098c..5851a721 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