Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / util / safe_getenv.c
blobe6c06381b1216153b47b6a6fcee5e51f149c0365
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* safe_getenv 3
6 /* SUMMARY
7 /* guarded getenv()
8 /* SYNOPSIS
9 /* #include <safe.h>
11 /* char *safe_getenv(const name)
12 /* char *name;
13 /* DESCRIPTION
14 /* The \fBsafe_getenv\fR() routine reads the named variable from the
15 /* environment, provided that the unsafe() routine agrees.
16 /* SEE ALSO
17 /* unsafe(3), detect non-user privileges
18 /* LICENSE
19 /* .ad
20 /* .fi
21 /* The Secure Mailer license must be distributed with this software.
22 /* AUTHOR(S)
23 /* Wietse Venema
24 /* IBM T.J. Watson Research
25 /* P.O. Box 704
26 /* Yorktown Heights, NY 10598, USA
27 /*--*/
29 /* System library. */
31 #include <sys_defs.h>
32 #include <stdlib.h>
34 /* Utility library. */
36 #include "safe.h"
38 /* safe_getenv - read environment variable with guard */
40 char *safe_getenv(const char *name)
42 return (unsafe() == 0 ? getenv(name) : 0);