view lib/secure_getenv.c @ 17313:8108e0239bb6

secure_getenv: new module * MODULES.html.sh (Extra functions based on ANSI C 89): Add secure_getenv. * doc/glibc-functions/secure_getenv.texi: New file. * doc/gnulib.texi: Include it. * lib/secure_getenv.c, m4/secure_getenv.m4, modules/secure_getenv: New files. * lib/stdlib.in.h (secure_getenv): New decl. * m4/stdlib_h.m4 (gl_STDLIB_H, gl_STDLIB_H_DEFAULTS): * modules/stdlib (stdlib.h): Add secure_getenv checks.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 04 Feb 2013 18:33:23 -0800
parents
children d77c98cd7cfd
line wrap: on
line source

/* Look up an environment variable more securely.

   Copyright 2013 Free Software Foundation, Inc.

   This program is free software: you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#include <stdlib.h>

char *
secure_getenv (char const *name)
{
#if HAVE___SECURE_GETENV
  return __secure_getenv (name);
#else
  return 0;
#endif
}