diff options
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r-- | security/smack/smack.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h index cc361b8f3d13..99b36124f712 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h | |||
@@ -43,7 +43,6 @@ struct superblock_smack { | |||
43 | char *smk_hat; | 43 | char *smk_hat; |
44 | char *smk_default; | 44 | char *smk_default; |
45 | int smk_initialized; | 45 | int smk_initialized; |
46 | spinlock_t smk_sblock; /* for initialization */ | ||
47 | }; | 46 | }; |
48 | 47 | ||
49 | struct socket_smack { | 48 | struct socket_smack { |
@@ -284,6 +283,19 @@ static inline char *smk_of_current(void) | |||
284 | } | 283 | } |
285 | 284 | ||
286 | /* | 285 | /* |
286 | * Is the task privileged and allowed to be privileged | ||
287 | * by the onlycap rule. | ||
288 | */ | ||
289 | static inline int smack_privileged(int cap) | ||
290 | { | ||
291 | if (!capable(cap)) | ||
292 | return 0; | ||
293 | if (smack_onlycap == NULL || smack_onlycap == smk_of_current()) | ||
294 | return 1; | ||
295 | return 0; | ||
296 | } | ||
297 | |||
298 | /* | ||
287 | * logging functions | 299 | * logging functions |
288 | */ | 300 | */ |
289 | #define SMACK_AUDIT_DENIED 0x1 | 301 | #define SMACK_AUDIT_DENIED 0x1 |