3 #ifndef _SET_EUGID_H_INCLUDED_
4 #define _SET_EUGID_H_INCLUDED_
10 /* set effective user and group attributes
12 /* #include <set_eugid.h>
16 /* External interface. */
18 extern void set_eugid(uid_t
, gid_t
);
21 * The following macros open and close a block that runs at a different
22 * privilege level. To make mistakes with stray curly braces less likely, we
23 * shape the macros below as the head and tail of a do-while loop.
25 #define SAVE_AND_SET_EUGID(uid, gid) do { \
26 uid_t __set_eugid_uid = geteuid(); \
27 gid_t __set_eugid_gid = getegid(); \
28 set_eugid((uid), (gid));
30 #define RESTORE_SAVED_EUGID() \
31 set_eugid(__set_eugid_uid, __set_eugid_gid); \
37 /* The Secure Mailer license must be distributed with this software.
40 /* IBM T.J. Watson Research
42 /* Yorktown Heights, NY 10598, USA