Commit c782f242f0602edf848355d41e3676753c2280c8
Committed by
Al Viro
1 parent
0ef1970d7f
Exists in
master
and in
4 other branches
[PATCH 1/2] audit: move extern declarations to audit.h
Leave audit_sig_{uid|pid|sid} protected by #ifdef CONFIG_AUDITSYSCALL. Noticed by sparse: kernel/audit.c:73:6: warning: symbol 'audit_ever_enabled' was not declared. Should it be static? kernel/audit.c:100:8: warning: symbol 'audit_sig_uid' was not declared. Should it be static? kernel/audit.c:101:8: warning: symbol 'audit_sig_pid' was not declared. Should it be static? kernel/audit.c:102:6: warning: symbol 'audit_sig_sid' was not declared. Should it be static? kernel/audit.c:117:23: warning: symbol 'audit_ih' was not declared. Should it be static? kernel/auditfilter.c:78:18: warning: symbol 'audit_filter_list' was not declared. Should it be static? Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 3 changed files with 13 additions and 11 deletions Side-by-side Diff
kernel/audit.h
... | ... | @@ -74,6 +74,11 @@ |
74 | 74 | struct audit_krule rule; |
75 | 75 | }; |
76 | 76 | |
77 | +#ifdef CONFIG_AUDIT | |
78 | +extern int audit_enabled; | |
79 | +extern int audit_ever_enabled; | |
80 | +#endif | |
81 | + | |
77 | 82 | extern int audit_pid; |
78 | 83 | |
79 | 84 | #define AUDIT_INODE_BUCKETS 32 |
... | ... | @@ -104,6 +109,9 @@ |
104 | 109 | int audit_send_list(void *); |
105 | 110 | |
106 | 111 | struct inotify_watch; |
112 | +/* Inotify handle */ | |
113 | +extern struct inotify_handle *audit_ih; | |
114 | + | |
107 | 115 | extern void audit_free_parent(struct inotify_watch *); |
108 | 116 | extern void audit_handle_ievent(struct inotify_watch *, u32, u32, u32, |
109 | 117 | const char *, struct inode *); |
... | ... | @@ -111,6 +119,7 @@ |
111 | 119 | |
112 | 120 | extern struct mutex audit_filter_mutex; |
113 | 121 | extern void audit_free_rule_rcu(struct rcu_head *); |
122 | +extern struct list_head audit_filter_list[]; | |
114 | 123 | |
115 | 124 | #ifdef CONFIG_AUDIT_TREE |
116 | 125 | extern struct audit_chunk *audit_tree_lookup(const struct inode *); |
... | ... | @@ -136,6 +145,10 @@ |
136 | 145 | #endif |
137 | 146 | |
138 | 147 | extern char *audit_unpack_string(void **, size_t *, size_t); |
148 | + | |
149 | +extern pid_t audit_sig_pid; | |
150 | +extern uid_t audit_sig_uid; | |
151 | +extern u32 audit_sig_sid; | |
139 | 152 | |
140 | 153 | #ifdef CONFIG_AUDITSYSCALL |
141 | 154 | extern int __audit_signal_info(int sig, struct task_struct *t); |
kernel/auditfilter.c
... | ... | @@ -89,13 +89,8 @@ |
89 | 89 | |
90 | 90 | DEFINE_MUTEX(audit_filter_mutex); |
91 | 91 | |
92 | -/* Inotify handle */ | |
93 | -extern struct inotify_handle *audit_ih; | |
94 | - | |
95 | 92 | /* Inotify events we care about. */ |
96 | 93 | #define AUDIT_IN_WATCH IN_MOVE|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF |
97 | - | |
98 | -extern int audit_enabled; | |
99 | 94 | |
100 | 95 | void audit_free_parent(struct inotify_watch *i_watch) |
101 | 96 | { |
kernel/auditsc.c
... | ... | @@ -68,9 +68,6 @@ |
68 | 68 | |
69 | 69 | #include "audit.h" |
70 | 70 | |
71 | -extern struct list_head audit_filter_list[]; | |
72 | -extern int audit_ever_enabled; | |
73 | - | |
74 | 71 | /* AUDIT_NAMES is the number of slots we reserve in the audit_context |
75 | 72 | * for saving names from getname(). */ |
76 | 73 | #define AUDIT_NAMES 20 |
... | ... | @@ -2361,9 +2358,6 @@ |
2361 | 2358 | struct audit_aux_data_pids *axp; |
2362 | 2359 | struct task_struct *tsk = current; |
2363 | 2360 | struct audit_context *ctx = tsk->audit_context; |
2364 | - extern pid_t audit_sig_pid; | |
2365 | - extern uid_t audit_sig_uid; | |
2366 | - extern u32 audit_sig_sid; | |
2367 | 2361 | |
2368 | 2362 | if (audit_pid && t->tgid == audit_pid) { |
2369 | 2363 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1) { |