summaryrefslogtreecommitdiffstats
path: root/src/tools/tools_util.h
diff options
context:
space:
mode:
authorOndrej Kos <okos@redhat.com>2013-02-07 11:26:45 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-02-11 15:45:10 +0100
commitf03094b1950325fd0d7f59fd626ac3d34ce56731 (patch)
tree47394c47c630e054ad5a41ffb10f212b862de4ac /src/tools/tools_util.h
parent075df914c0355e1dcafad1a128877be11241725c (diff)
downloadsssd-f03094b1950325fd0d7f59fd626ac3d34ce56731.tar.gz
sssd-f03094b1950325fd0d7f59fd626ac3d34ce56731.tar.xz
sssd-f03094b1950325fd0d7f59fd626ac3d34ce56731.zip
TOOLS: Use file descriptor to avoid races when creating a home directory
When creating a home directory, the destination tree can be modified in various ways while it is being constructed because directory permissions are set before populating the directory. This can lead to file creation and permission changes outside the target directory tree, using hard links. This security problem was assigned CVE-2013-0219 https://fedorahosted.org/sssd/ticket/1782
Diffstat (limited to 'src/tools/tools_util.h')
-rw-r--r--src/tools/tools_util.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tools/tools_util.h b/src/tools/tools_util.h
index e8b253616..c0978af1d 100644
--- a/src/tools/tools_util.h
+++ b/src/tools/tools_util.h
@@ -104,9 +104,8 @@ int run_userdel_cmd(struct tools_ctx *tctx);
/* 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 copy_tree(const char *src_root, const char *dst_root,
+ mode_t mode_root, uid_t uid, gid_t gid);
/* from nscd.c */
enum nscd_db {