pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/sudo sudo: avoid segfault if hostname is empty



details:   https://anonhg.NetBSD.org/pkgsrc/rev/63b2337e1a16
branches:  trunk
changeset: 374047:63b2337e1a16
user:      maya <maya%pkgsrc.org@localhost>
date:      Sun Jan 14 15:29:38 2018 +0000

description:
sudo: avoid segfault if hostname is empty

from andrew hall in pr pkg/52923
PKGREVISION++

diffstat:

 security/sudo/Makefile                             |   3 ++-
 security/sudo/distinfo                             |   3 ++-
 security/sudo/patches/patch-lib_util_gethostname.c |  16 ++++++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r d5e7ea23bf65 -r 63b2337e1a16 security/sudo/Makefile
--- a/security/sudo/Makefile    Sun Jan 14 15:26:46 2018 +0000
+++ b/security/sudo/Makefile    Sun Jan 14 15:29:38 2018 +0000
@@ -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 -r d5e7ea23bf65 -r 63b2337e1a16 security/sudo/distinfo
--- a/security/sudo/distinfo    Sun Jan 14 15:26:46 2018 +0000
+++ b/security/sudo/distinfo    Sun Jan 14 15:29:38 2018 +0000
@@ -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-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 -r d5e7ea23bf65 -r 63b2337e1a16 security/sudo/patches/patch-lib_util_gethostname.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/sudo/patches/patch-lib_util_gethostname.c        Sun Jan 14 15:29:38 2018 +0000
@@ -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 {



Home | Main Index | Thread Index | Old Index