From: David Howells Date: Fri, 26 Feb 2010 01:56:16 +0000 (+0000) Subject: SELinux: Make selinux_kernel_create_files_as() shouldn't just always return 0 X-Git-Tag: v2.6.34-rc1~228^2^2 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=ef57471a73b67a7b65fd8708fd55c77cb7c619af;p=net-next-2.6.git SELinux: Make selinux_kernel_create_files_as() shouldn't just always return 0 Make selinux_kernel_create_files_as() return an error when it gets one, rather than unconditionally returning 0. Without this, cachefiles doesn't return an error if the SELinux policy doesn't let it create files with the label of the directory at the base of the cache. Signed-off-by: David Howells Signed-off-by: James Morris --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index dc7660074b9..5feecb41009 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3329,7 +3329,7 @@ static int selinux_kernel_create_files_as(struct cred *new, struct inode *inode) if (ret == 0) tsec->create_sid = isec->sid; - return 0; + return ret; } static int selinux_kernel_module_request(char *kmod_name)