Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
[linux-2.6/sactl.git] / include / linux / cred.h
blobb69222cc1fd27c1811ae473f1eccc4e5f69dd07c
1 /* Credentials management
3 * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
12 #ifndef _LINUX_CRED_H
13 #define _LINUX_CRED_H
15 #define get_current_user() (get_uid(current->user))
17 #define task_uid(task) ((task)->uid)
18 #define task_gid(task) ((task)->gid)
19 #define task_euid(task) ((task)->euid)
20 #define task_egid(task) ((task)->egid)
22 #define current_uid() (current->uid)
23 #define current_gid() (current->gid)
24 #define current_euid() (current->euid)
25 #define current_egid() (current->egid)
26 #define current_suid() (current->suid)
27 #define current_sgid() (current->sgid)
28 #define current_fsuid() (current->fsuid)
29 #define current_fsgid() (current->fsgid)
30 #define current_cap() (current->cap_effective)
32 #define current_uid_gid(_uid, _gid) \
33 do { \
34 *(_uid) = current->uid; \
35 *(_gid) = current->gid; \
36 } while(0)
38 #define current_euid_egid(_uid, _gid) \
39 do { \
40 *(_uid) = current->euid; \
41 *(_gid) = current->egid; \
42 } while(0)
44 #define current_fsuid_fsgid(_uid, _gid) \
45 do { \
46 *(_uid) = current->fsuid; \
47 *(_gid) = current->fsgid; \
48 } while(0)
50 #endif /* _LINUX_CRED_H */