aboutsummaryrefslogtreecommitdiffstats
path: root/security/commoncap.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-12-30 00:20:30 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-12-30 00:21:47 -0500
commitd392da5207352f09030e95d9ea335a4225667ec0 (patch)
tree7d6cd1932afcad0a5619a5c504a6d93ca318187c /security/commoncap.c
parente39d5ef678045d61812c1401f04fe8edb14d6359 (diff)
parent387c31c7e5c9805b0aef8833d1731a5fe7bdea14 (diff)
Merge v2.6.37-rc8 into powerpc/next
Diffstat (limited to 'security/commoncap.c')
-rw-r--r--security/commoncap.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index 4e015996dd4d..64c2ed9c9015 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -27,7 +27,6 @@
27#include <linux/sched.h> 27#include <linux/sched.h>
28#include <linux/prctl.h> 28#include <linux/prctl.h>
29#include <linux/securebits.h> 29#include <linux/securebits.h>
30#include <linux/syslog.h>
31 30
32/* 31/*
33 * If a non-root user executes a setuid-root binary in 32 * If a non-root user executes a setuid-root binary in
@@ -40,7 +39,7 @@
40 * 39 *
41 * Warn if that happens, once per boot. 40 * Warn if that happens, once per boot.
42 */ 41 */
43static void warn_setuid_and_fcaps_mixed(char *fname) 42static void warn_setuid_and_fcaps_mixed(const char *fname)
44{ 43{
45 static int warned; 44 static int warned;
46 if (!warned) { 45 if (!warned) {
@@ -719,14 +718,11 @@ static int cap_safe_nice(struct task_struct *p)
719/** 718/**
720 * cap_task_setscheduler - Detemine if scheduler policy change is permitted 719 * cap_task_setscheduler - Detemine if scheduler policy change is permitted
721 * @p: The task to affect 720 * @p: The task to affect
722 * @policy: The policy to effect
723 * @lp: The parameters to the scheduling policy
724 * 721 *
725 * Detemine if the requested scheduler policy change is permitted for the 722 * Detemine if the requested scheduler policy change is permitted for the
726 * specified task, returning 0 if permission is granted, -ve if denied. 723 * specified task, returning 0 if permission is granted, -ve if denied.
727 */ 724 */
728int cap_task_setscheduler(struct task_struct *p, int policy, 725int cap_task_setscheduler(struct task_struct *p)
729 struct sched_param *lp)
730{ 726{
731 return cap_safe_nice(p); 727 return cap_safe_nice(p);
732} 728}
@@ -887,24 +883,6 @@ error:
887} 883}
888 884
889/** 885/**
890 * cap_syslog - Determine whether syslog function is permitted
891 * @type: Function requested
892 * @from_file: Whether this request came from an open file (i.e. /proc)
893 *
894 * Determine whether the current process is permitted to use a particular
895 * syslog function, returning 0 if permission is granted, -ve if not.
896 */
897int cap_syslog(int type, bool from_file)
898{
899 if (type != SYSLOG_ACTION_OPEN && from_file)
900 return 0;
901 if ((type != SYSLOG_ACTION_READ_ALL &&
902 type != SYSLOG_ACTION_SIZE_BUFFER) && !capable(CAP_SYS_ADMIN))
903 return -EPERM;
904 return 0;
905}
906
907/**
908 * cap_vm_enough_memory - Determine whether a new virtual mapping is permitted 886 * cap_vm_enough_memory - Determine whether a new virtual mapping is permitted
909 * @mm: The VM space in which the new mapping is to be made 887 * @mm: The VM space in which the new mapping is to be made
910 * @pages: The size of the mapping 888 * @pages: The size of the mapping