Darrel Goeddel | 376bd9c | 2006-02-24 15:44:05 -0600 | [diff] [blame^] | 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 | } |