7 /* are we running at non-user privileges
13 /* The \fBunsafe()\fR routine attempts to determine if the process runs
14 /* with any privileges that do not belong to the user. The purpose is
15 /* to make it easy to taint any user-provided data such as the current
16 /* working directory, the process environment, etcetera.
18 /* On UNIX systems, the result is true when any of the following
19 /* conditions is true:
21 /* The issetuid kernel flag is non-zero (on systems that support
24 /* The real and effective user id differ.
26 /* The real and effective group id differ.
30 /* The Secure Mailer license must be distributed with this software.
33 /* IBM T.J. Watson Research
35 /* Yorktown Heights, NY 10598, USA
43 /* Utility library. */
47 /* unsafe - can we trust user-provided environment, working directory, etc. */
51 return (geteuid() != getuid()
55 || getgid() != getegid());