lkml.org 
[lkml]   [2005]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 1/1] selinux: minor cleanup in the hooks.c:file_map_prot_check() code
From
Date

Minor cleanup of the SELinux hooks code (hooks.c) around
some definitions of return values.

Signed-off-by: Lorenzo Hernandez Garcia-Hierro <lorenzo@gnu.org>
---

security/selinux/hooks.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN security/selinux/hooks.c~selinux-kernel-cleanup-1 security/selinux/hooks.c
--- linux-2.6.11/security/selinux/hooks.c~selinux-kernel-cleanup-1 2005-06-21 13:26:23.000000000 +0200
+++ linux-2.6.11-lorenzo/security/selinux/hooks.c 2005-06-23 00:11:23.129839992 +0200
@@ -2419,6 +2419,8 @@ static int selinux_file_ioctl(struct fil

static int file_map_prot_check(struct file *file, unsigned long prot, int shared)
{
+ int rc;
+
#ifndef CONFIG_PPC32
if ((prot & PROT_EXEC) && (!file || (!shared && (prot & PROT_WRITE)))) {
/*
@@ -2426,7 +2428,7 @@ static int file_map_prot_check(struct fi
* private file mapping that will also be writable.
* This has an additional check.
*/
- int rc = task_has_perm(current, current, PROCESS__EXECMEM);
+ rc = task_has_perm(current, current, PROCESS__EXECMEM);
if (rc)
return rc;
}
@@ -2485,7 +2487,7 @@ static int selinux_file_mprotect(struct
* check ability to execute the possibly modified content.
* This typically should only occur for text relocations.
*/
- int rc = file_has_perm(current, vma->vm_file, FILE__EXECMOD);
+ rc = file_has_perm(current, vma->vm_file, FILE__EXECMOD);
if (rc)
return rc;
}
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-06-23 00:35    [W:0.047 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site