diff options
Diffstat (limited to 'security/selinux/exports.c')
-rw-r--r-- | security/selinux/exports.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/security/selinux/exports.c b/security/selinux/exports.c new file mode 100644 index 000000000000..333c4c7824d8 --- /dev/null +++ b/security/selinux/exports.c | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * SELinux services exported to the rest of the kernel. | ||
3 | * | ||
4 | * Author: James Morris <jmorris@redhat.com> | ||
5 | * | ||
6 | * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com> | ||
7 | * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2, | ||
11 | * as published by the Free Software Foundation. | ||
12 | */ | ||
13 | #include <linux/types.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/selinux.h> | ||
17 | |||
18 | #include "security.h" | ||
19 | #include "objsec.h" | ||
20 | |||
21 | void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid) | ||
22 | { | ||
23 | struct task_security_struct *tsec = tsk->security; | ||
24 | if (selinux_enabled) | ||
25 | *ctxid = tsec->sid; | ||
26 | else | ||
27 | *ctxid = 0; | ||
28 | } | ||