diff options
| author | Paul Eggert | 2017-08-09 11:38:04 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-08-09 11:46:06 -0700 |
| commit | 904be8c4cf8522a54a85542954bd553b6dbd0b64 (patch) | |
| tree | 7f0c1eac5585e02a5461b36224490938cbcf3e92 /lib | |
| parent | 7fc27ea70bc7dc24776b2c098ac970f2f21e37fb (diff) | |
| download | emacs-904be8c4cf8522a54a85542954bd553b6dbd0b64.tar.gz 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@ | |||
| 903 | gl_GNULIB_ENABLED_euidaccess = @gl_GNULIB_ENABLED_euidaccess@ | 903 | gl_GNULIB_ENABLED_euidaccess = @gl_GNULIB_ENABLED_euidaccess@ |
| 904 | gl_GNULIB_ENABLED_getdtablesize = @gl_GNULIB_ENABLED_getdtablesize@ | 904 | gl_GNULIB_ENABLED_getdtablesize = @gl_GNULIB_ENABLED_getdtablesize@ |
| 905 | gl_GNULIB_ENABLED_getgroups = @gl_GNULIB_ENABLED_getgroups@ | 905 | gl_GNULIB_ENABLED_getgroups = @gl_GNULIB_ENABLED_getgroups@ |
| 906 | gl_GNULIB_ENABLED_secure_getenv = @gl_GNULIB_ENABLED_secure_getenv@ | ||
| 907 | gl_GNULIB_ENABLED_strtoll = @gl_GNULIB_ENABLED_strtoll@ | 906 | gl_GNULIB_ENABLED_strtoll = @gl_GNULIB_ENABLED_strtoll@ |
| 908 | gl_GNULIB_ENABLED_tempname = @gl_GNULIB_ENABLED_tempname@ | 907 | gl_GNULIB_ENABLED_tempname = @gl_GNULIB_ENABLED_tempname@ |
| 909 | gl_LIBOBJS = @gl_LIBOBJS@ | 908 | gl_LIBOBJS = @gl_LIBOBJS@ |
| @@ -1912,19 +1911,6 @@ EXTRA_DIST += root-uid.h | |||
| 1912 | endif | 1911 | endif |
| 1913 | ## end gnulib module root-uid | 1912 | ## end gnulib module root-uid |
| 1914 | 1913 | ||
| 1915 | ## begin gnulib module secure_getenv | ||
| 1916 | ifeq (,$(OMIT_GNULIB_MODULE_secure_getenv)) | ||
| 1917 | |||
| 1918 | ifneq (,$(gl_GNULIB_ENABLED_secure_getenv)) | ||
| 1919 | |||
| 1920 | endif | ||
| 1921 | EXTRA_DIST += secure_getenv.c | ||
| 1922 | |||
| 1923 | EXTRA_libgnu_a_SOURCES += secure_getenv.c | ||
| 1924 | |||
| 1925 | endif | ||
| 1926 | ## end gnulib module secure_getenv | ||
| 1927 | |||
| 1928 | ## begin gnulib module sig2str | 1914 | ## begin gnulib module sig2str |
| 1929 | ifeq (,$(OMIT_GNULIB_MODULE_sig2str)) | 1915 | ifeq (,$(OMIT_GNULIB_MODULE_sig2str)) |
| 1930 | 1916 | ||
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 @@ | |||
| 1 | /* Look up an environment variable, returning NULL in insecure situations. | ||
| 2 | |||
| 3 | Copyright 2013-2017 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This program is free software: you can redistribute it and/or modify it | ||
| 6 | under the terms of the GNU General Public License as published | ||
| 7 | by the Free Software Foundation; either version 3 of the License, or | ||
| 8 | (at your option) any later version. | ||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 17 | |||
| 18 | #include <config.h> | ||
| 19 | |||
| 20 | #include <stdlib.h> | ||
| 21 | |||
| 22 | #if !HAVE___SECURE_GETENV | ||
| 23 | # if HAVE_ISSETUGID || (HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID) | ||
| 24 | # include <unistd.h> | ||
| 25 | # endif | ||
| 26 | #endif | ||
| 27 | |||
| 28 | char * | ||
| 29 | secure_getenv (char const *name) | ||
| 30 | { | ||
| 31 | #if HAVE___SECURE_GETENV /* glibc */ | ||
| 32 | return __secure_getenv (name); | ||
| 33 | #elif HAVE_ISSETUGID /* OS X, FreeBSD, NetBSD, OpenBSD */ | ||
| 34 | if (issetugid ()) | ||
| 35 | return NULL; | ||
| 36 | return getenv (name); | ||
| 37 | #elif HAVE_GETUID && HAVE_GETEUID && HAVE_GETGID && HAVE_GETEGID /* other Unix */ | ||
| 38 | if (geteuid () != getuid () || getegid () != getgid ()) | ||
| 39 | return NULL; | ||
| 40 | return getenv (name); | ||
| 41 | #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* native Windows */ | ||
| 42 | /* On native Windows, there is no such concept as setuid or setgid binaries. | ||
| 43 | - Programs launched as system services have high privileges, but they don't | ||
| 44 | inherit environment variables from a user. | ||
| 45 | - Programs launched by a user with "Run as Administrator" have high | ||
| 46 | privileges and use the environment variables, but the user has been asked | ||
| 47 | whether he agrees. | ||
| 48 | - Programs launched by a user without "Run as Administrator" cannot gain | ||
| 49 | high privileges, therefore there is no risk. */ | ||
| 50 | return getenv (name); | ||
| 51 | #else | ||
| 52 | return NULL; | ||
| 53 | #endif | ||
| 54 | } | ||
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 @@ | |||
| 69 | # define __mkdir mkdir | 69 | # define __mkdir mkdir |
| 70 | # define __open open | 70 | # define __open open |
| 71 | # define __lxstat64(version, file, buf) lstat (file, buf) | 71 | # define __lxstat64(version, file, buf) lstat (file, buf) |
| 72 | # define __secure_getenv secure_getenv | ||
| 73 | #endif | 72 | #endif |
| 74 | 73 | ||
| 75 | #ifdef _LIBC | 74 | #ifdef _LIBC |