[SCSI] isci: atapi support
[linux-2.6.git] / security / capability.c
index 66cd745..2984ea4 100644 (file)
 
 #include <linux/security.h>
 
-static int cap_acct(struct file *file)
-{
-       return 0;
-}
-
-static int cap_sysctl(ctl_table *table, int op)
+static int cap_syslog(int type)
 {
        return 0;
 }
@@ -32,7 +27,7 @@ static int cap_quota_on(struct dentry *dentry)
        return 0;
 }
 
-static int cap_bprm_check_security (struct linux_binprm *bprm)
+static int cap_bprm_check_security(struct linux_binprm *bprm)
 {
        return 0;
 }
@@ -59,6 +54,11 @@ static int cap_sb_copy_data(char *orig, char *copy)
        return 0;
 }
 
+static int cap_sb_remount(struct super_block *sb, void *data)
+{
+       return 0;
+}
+
 static int cap_sb_kern_mount(struct super_block *sb, int flags, void *data)
 {
        return 0;
@@ -118,7 +118,8 @@ static void cap_inode_free_security(struct inode *inode)
 }
 
 static int cap_inode_init_security(struct inode *inode, struct inode *dir,
-                                  char **name, void **value, size_t *len)
+                                  const struct qstr *qstr, char **name,
+                                  void **value, size_t *len)
 {
        return -EOPNOTSUPP;
 }
@@ -273,8 +274,7 @@ static int cap_path_rename(struct path *old_path, struct dentry *old_dentry,
        return 0;
 }
 
-static int cap_path_truncate(struct path *path, loff_t length,
-                            unsigned int time_attrs)
+static int cap_path_truncate(struct path *path)
 {
        return 0;
 }
@@ -412,17 +412,13 @@ static void cap_task_getsecid(struct task_struct *p, u32 *secid)
        *secid = 0;
 }
 
-static int cap_task_setgroups(struct group_info *group_info)
-{
-       return 0;
-}
-
 static int cap_task_getioprio(struct task_struct *p)
 {
        return 0;
 }
 
-static int cap_task_setrlimit(unsigned int resource, struct rlimit *new_rlim)
+static int cap_task_setrlimit(struct task_struct *p, unsigned int resource,
+               struct rlimit *new_rlim)
 {
        return 0;
 }
@@ -553,7 +549,7 @@ static int cap_sem_semop(struct sem_array *sma, struct sembuf *sops,
 }
 
 #ifdef CONFIG_SECURITY_NETWORK
-static int cap_unix_stream_connect(struct socket *sock, struct socket *other,
+static int cap_unix_stream_connect(struct sock *sock, struct sock *other,
                                   struct sock *newsk)
 {
        return 0;
@@ -687,7 +683,18 @@ static void cap_inet_conn_established(struct sock *sk, struct sk_buff *skb)
 {
 }
 
+static int cap_secmark_relabel_packet(u32 secid)
+{
+       return 0;
+}
 
+static void cap_secmark_refcount_inc(void)
+{
+}
+
+static void cap_secmark_refcount_dec(void)
+{
+}
 
 static void cap_req_classify_flow(const struct request_sock *req,
                                  struct flowi *fl)
@@ -754,7 +761,7 @@ static int cap_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 sk_sid, u8 dir)
 
 static int cap_xfrm_state_pol_flow_match(struct xfrm_state *x,
                                         struct xfrm_policy *xp,
-                                        struct flowi *fl)
+                                        const struct flowi *fl)
 {
        return 1;
 }
@@ -787,7 +794,8 @@ static int cap_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
 
 static int cap_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid)
 {
-       return -EOPNOTSUPP;
+       *secid = 0;
+       return 0;
 }
 
 static void cap_release_secctx(char *secdata, u32 seclen)
@@ -831,13 +839,6 @@ static int cap_key_getsecurity(struct key *key, char **_buffer)
        return 0;
 }
 
-static int cap_key_session_to_parent(const struct cred *cred,
-                                    const struct cred *parent_cred,
-                                    struct key *key)
-{
-       return 0;
-}
-
 #endif /* CONFIG_KEYS */
 
 #ifdef CONFIG_AUDIT
@@ -871,17 +872,15 @@ static void cap_audit_rule_free(void *lsmrule)
                        }                                               \
        } while (0)
 
-void security_fixup_ops(struct security_operations *ops)
+void __init security_fixup_ops(struct security_operations *ops)
 {
        set_to_cap_if_null(ops, ptrace_access_check);
        set_to_cap_if_null(ops, ptrace_traceme);
        set_to_cap_if_null(ops, capget);
        set_to_cap_if_null(ops, capset);
-       set_to_cap_if_null(ops, acct);
        set_to_cap_if_null(ops, capable);
        set_to_cap_if_null(ops, quotactl);
        set_to_cap_if_null(ops, quota_on);
-       set_to_cap_if_null(ops, sysctl);
        set_to_cap_if_null(ops, syslog);
        set_to_cap_if_null(ops, settime);
        set_to_cap_if_null(ops, vm_enough_memory);
@@ -893,6 +892,7 @@ void security_fixup_ops(struct security_operations *ops)
        set_to_cap_if_null(ops, sb_alloc_security);
        set_to_cap_if_null(ops, sb_free_security);
        set_to_cap_if_null(ops, sb_copy_data);
+       set_to_cap_if_null(ops, sb_remount);
        set_to_cap_if_null(ops, sb_kern_mount);
        set_to_cap_if_null(ops, sb_show_options);
        set_to_cap_if_null(ops, sb_statfs);
@@ -967,7 +967,6 @@ void security_fixup_ops(struct security_operations *ops)
        set_to_cap_if_null(ops, task_getpgid);
        set_to_cap_if_null(ops, task_getsid);
        set_to_cap_if_null(ops, task_getsecid);
-       set_to_cap_if_null(ops, task_setgroups);
        set_to_cap_if_null(ops, task_setnice);
        set_to_cap_if_null(ops, task_setioprio);
        set_to_cap_if_null(ops, task_getioprio);
@@ -1037,6 +1036,9 @@ void security_fixup_ops(struct security_operations *ops)
        set_to_cap_if_null(ops, inet_conn_request);
        set_to_cap_if_null(ops, inet_csk_clone);
        set_to_cap_if_null(ops, inet_conn_established);
+       set_to_cap_if_null(ops, secmark_relabel_packet);
+       set_to_cap_if_null(ops, secmark_refcount_inc);
+       set_to_cap_if_null(ops, secmark_refcount_dec);
        set_to_cap_if_null(ops, req_classify_flow);
        set_to_cap_if_null(ops, tun_dev_create);
        set_to_cap_if_null(ops, tun_dev_post_create);
@@ -1059,7 +1061,6 @@ void security_fixup_ops(struct security_operations *ops)
        set_to_cap_if_null(ops, key_free);
        set_to_cap_if_null(ops, key_permission);
        set_to_cap_if_null(ops, key_getsecurity);
-       set_to_cap_if_null(ops, key_session_to_parent);
 #endif /* CONFIG_KEYS */
 #ifdef CONFIG_AUDIT
        set_to_cap_if_null(ops, audit_rule_init);