Skip to content

Commit

Permalink
SELinux: Make selinux_kernel_create_files_as() shouldn't just always …
Browse files Browse the repository at this point in the history
…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 <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
David Howells authored and James Morris committed Feb 26, 2010
1 parent 1fcdc7c commit ef57471
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef57471

Please sign in to comment.