diff options
author | maya <maya@pkgsrc.org> | 2018-01-14 15:29:38 +0000 |
---|---|---|
committer | maya <maya@pkgsrc.org> | 2018-01-14 15:29:38 +0000 |
commit | 13b5f211bcdcd88bb5787fb21042e6f9d68ca7aa (patch) | |
tree | 83c3882da0f35b8efaa6d09c744db7efb2d6bb23 /security/sudo | |
parent | 3de9c508fd927d90f453e378deda1271d40ffa51 (diff) | |
download | pkgsrc-13b5f211bcdcd88bb5787fb21042e6f9d68ca7aa.tar.gz |
sudo: avoid segfault if hostname is empty
from andrew hall in pr pkg/52923
PKGREVISION++
Diffstat (limited to 'security/sudo')
-rw-r--r-- | security/sudo/Makefile | 3 | ||||
-rw-r--r-- | security/sudo/distinfo | 3 | ||||
-rw-r--r-- | security/sudo/patches/patch-lib_util_gethostname.c | 16 |
3 files changed, 20 insertions, 2 deletions
diff --git a/security/sudo/Makefile b/security/sudo/Makefile index 6497a4c50a4..eb91c5a2215 100644 --- a/security/sudo/Makefile +++ b/security/sudo/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.157 2017/09/12 06:34:22 adam Exp $ +# $NetBSD: Makefile,v 1.158 2018/01/14 15:29:38 maya Exp $ DISTNAME= sudo-1.8.21p2 +PKGREVISION= 1 CATEGORIES= security MASTER_SITES= https://www.sudo.ws/dist/ MASTER_SITES+= ftp://ftp.sudo.ws/pub/sudo/ diff --git a/security/sudo/distinfo b/security/sudo/distinfo index dd464de4f52..6ef9fdbd222 100644 --- a/security/sudo/distinfo +++ b/security/sudo/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.93 2017/09/12 06:34:22 adam Exp $ +$NetBSD: distinfo,v 1.94 2018/01/14 15:29:38 maya Exp $ SHA1 (sudo-1.8.21p2.tar.gz) = 1a2410517a5e7b74f422b120adedf508b346df66 RMD160 (sudo-1.8.21p2.tar.gz) = fbac868cbf7261a4e9bda538ac93792b6512628c @@ -9,6 +9,7 @@ SHA1 (patch-af) = db54ce780c174129e2a25a87f3e3a926596c68b2 SHA1 (patch-ag) = 460b9575346c263b944535aa8e2408e959840c77 SHA1 (patch-include_sudo__compat.h) = 4f9b021ebdd507949f13e289deabdb6090ab334c SHA1 (patch-include_sudo__event.h) = 4d0787a45c2c7d4a7d3ae3111ccb3a4a4b84d083 +SHA1 (patch-lib_util_gethostname.c) = 5ec89ca91d483277c844a9e8941ece37918864c8 SHA1 (patch-plugins_sudoers_Makefile.in) = d8612ac7bf2f5a892d9720c4df91810ca807f4ed SHA1 (patch-plugins_sudoers_logging.c) = a42e54af2b6057804aecb3b6a48c565e8ac4df82 SHA1 (patch-src_Makefile.in) = fc2b7ea0835d7fe3192fb12cac8ab2eac61bf132 diff --git a/security/sudo/patches/patch-lib_util_gethostname.c b/security/sudo/patches/patch-lib_util_gethostname.c new file mode 100644 index 00000000000..0ededb0a835 --- /dev/null +++ b/security/sudo/patches/patch-lib_util_gethostname.c @@ -0,0 +1,16 @@ +$NetBSD: patch-lib_util_gethostname.c,v 1.1 2018/01/14 15:29:38 maya Exp $ + +Avoid segfault if hostname is not set +(upstream commit) + +--- lib/util/gethostname.c.orig 2017-01-14 04:30:15.000000000 +0000 ++++ lib/util/gethostname.c +@@ -42,7 +42,7 @@ sudo_gethostname_v1(void) + + hname = malloc(host_name_max + 1); + if (hname != NULL) { +- if (gethostname(hname, host_name_max + 1) == 0) { ++ if (gethostname(hname, host_name_max + 1) == 0 && *hname != '\0') { + /* Old gethostname() may not NUL-terminate if there is no room. */ + hname[host_name_max] = '\0'; + } else { |