aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/exports.c
blob: 333c4c7824d8c738320d921ffa830ce31642885f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * SELinux services exported to the rest of the kernel.
 *
 * Author: James Morris <jmorris@redhat.com>
 *
 * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com>
 * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/selinux.h>

#include "security.h"
#include "objsec.h"

void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
{
	struct task_security_struct *tsec = tsk->security;
	if (selinux_enabled)
		*ctxid = tsec->sid;
	else
		*ctxid = 0;
}