diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-09 11:38:04 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-09 11:46:06 -0700 |
commit | 904be8c4cf8522a54a85542954bd553b6dbd0b64 (patch) | |
tree | 7f0c1eac5585e02a5461b36224490938cbcf3e92 /lib | |
parent | 7fc27ea70bc7dc24776b2c098ac970f2f21e37fb (diff) | |
download | emacs-904be8c4cf8522a54a85542954bd553b6dbd0b64.tar.gz emacs-904be8c4cf8522a54a85542954bd553b6dbd0b64.tar.bz2 emacs-904be8c4cf8522a54a85542954bd553b6dbd0b64.zip |
Merge from gnulib
This incorporates:
2017-08-09 tempname: do not depend on secure_getenv
2017-08-08 extensions: add _OPENBSD_SOURCE
2017-08-06 manywarnings: Add support for C++
2017-08-06 warnings, manywarnings: Add support for multiple languages
* admin/merge-gnulib: Don't use m4/manywarnings-c++.m4.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/secure_getenv.c, m4/secure_getenv.m4: Remove.
* lib/tempname.c, m4/extensions.m4, m4/manywarnings.m4, m4/warnings.m4:
Copy from gnulib.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gnulib.mk.in | 14 | ||||
-rw-r--r-- | lib/secure_getenv.c | 54 | ||||
-rw-r--r-- | lib/tempname.c | 1 |
3 files changed, 0 insertions, 69 deletions
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index a385c8c8384..c5df3f42e47 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -903,7 +903,6 @@ gl_GNULIB_ENABLED_dosname = @gl_GNULIB_ENABLED_dosname@ gl_GNULIB_ENABLED_euidaccess = @gl_GNULIB_ENABLED_euidaccess@ gl_GNULIB_ENABLED_getdtablesize = @gl_GNULIB_ENABLED_getdtablesize@ gl_GNULIB_ENABLED_getgroups = @gl_GNULIB_ENABLED_getgroups@ -gl_GNULIB_ENABLED_secure_getenv = @gl_GNULIB_ENABLED_secure_getenv@ gl_GNULIB_ENABLED_strtoll = @gl_GNULIB_ENABLED_strtoll@ gl_GNULIB_ENABLED_tempname = @gl_GNULIB_ENABLED_tempname@ gl_LIBOBJS = @gl_LIBOBJS@ @@ -1912,19 +1911,6 @@ EXTRA_DIST += root-uid.h endif ## end gnulib module root-uid -## begin gnulib module secure_getenv -ifeq (,$(OMIT_GNULIB_MODULE_secure_getenv)) - -ifneq (,$(gl_GNULIB_ENABLED_secure_getenv)) - -endif -EXTRA_DIST += secure_getenv.c - -EXTRA_libgnu_a_SOURCES += secure_getenv.c - -endif -## end gnulib module secure_getenv - ## begin gnulib module sig2str ifeq (,$(OMIT_GNULIB_MODULE_sig2str)) diff --git a/lib/secure_getenv.c b/lib/secure_getenv.c deleted file mode 100644 index df53dea0b2f..00000000000 --- a/lib/secure_getenv.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Look up an environment variable, returning NULL in insecure situations. - - Copyright 2013-2017 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#include <config.h> - -#include <stdlib.h> - -#if !HAVE___SECURE_GETENV -# if HAVE_ISSETUGID || (HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID) -# include <unistd.h> -# endif -#endif - -char * -secure_getenv (char const *name) -{ -#if HAVE___SECURE_GETENV /* glibc */ - return __secure_getenv (name); -#elif HAVE_ISSETUGID /* OS X, FreeBSD, NetBSD, OpenBSD */ - if (issetugid ()) - return NULL; - return getenv (name); -#elif HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID /* other Unix */ - if (geteuid () != getuid () || getegid () != getgid ()) - return NULL; - return getenv (name); -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* native Windows */ - /* On native Windows, there is no such concept as setuid or setgid binaries. - - Programs launched as system services have high privileges, but they don't - inherit environment variables from a user. - - Programs launched by a user with "Run as Administrator" have high - privileges and use the environment variables, but the user has been asked - whether he agrees. - - Programs launched by a user without "Run as Administrator" cannot gain - high privileges, therefore there is no risk. */ - return getenv (name); -#else - return NULL; -#endif -} diff --git a/lib/tempname.c b/lib/tempname.c index 9c4a3c2a54d..c274b8dd4e1 100644 --- a/lib/tempname.c +++ b/lib/tempname.c @@ -69,7 +69,6 @@ # define __mkdir mkdir # define __open open # define __lxstat64(version, file, buf) lstat (file, buf) -# define __secure_getenv secure_getenv #endif #ifdef _LIBC |