blob: 333c4c7824d8c738320d921ffa830ce31642885f [file] [log] [blame]
Darrel Goeddel376bd9c2006-02-24 15:44:05 -06001/*
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
21void 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}