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.
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) \
34 *(_uid) = current->uid; \
35 *(_gid) = current->gid; \
38 #define current_euid_egid(_uid, _gid) \
40 *(_uid) = current->euid; \
41 *(_gid) = current->egid; \
44 #define current_fsuid_fsgid(_uid, _gid) \
46 *(_uid) = current->fsuid; \
47 *(_gid) = current->fsgid; \
50 #endif /* _LINUX_CRED_H */