Date: Mon, 25 Feb 2019 13:37:48 +0000 (UTC) From: Renato Botelho <garga@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r493861 - in head/shells/scponly: . files Message-ID: <201902251337.x1PDbmSM063211@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: garga Date: Mon Feb 25 13:37:48 2019 New Revision: 493861 URL: https://svnweb.freebsd.org/changeset/ports/493861 Log: shells/scponly: fix segfault on FreeBSD 12 and newer On FreeBSD 12+ basename(3) writes to its argument, which in scponly isn't a writable string, so it segfaults. This patch works around it. PR: 235810 Submitted by: fullermd@over-yonder.net Added: head/shells/scponly/files/patch-helper.c (contents, props changed) Modified: head/shells/scponly/Makefile Modified: head/shells/scponly/Makefile ============================================================================== --- head/shells/scponly/Makefile Mon Feb 25 13:28:39 2019 (r493860) +++ head/shells/scponly/Makefile Mon Feb 25 13:37:48 2019 (r493861) @@ -3,7 +3,7 @@ PORTNAME= scponly PORTVERSION= 4.8.20110526 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= shells security MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-snapshots DISTNAME= ${PORTNAME}-20110526 Added: head/shells/scponly/files/patch-helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/shells/scponly/files/patch-helper.c Mon Feb 25 13:37:48 2019 (r493861) @@ -0,0 +1,26 @@ +--- helper.c.orig 2010-09-08 05:58:11 UTC ++++ helper.c +@@ -323,16 +323,20 @@ int valid_arg_vector(char **av) + char *substitute_known_path(char *request) + { + cmd_t *cmd=commands; +- char *stripped_req=strdup(basename(request)); ++ char *stripped_req=strdup(request); ++ stripped_req=basename(stripped_req); + while (cmd != NULL) + { ++ char *nname; + if (cmd->name == NULL) + break; +- if (exact_match(basename(cmd->name),stripped_req)) ++ nname = strdup(cmd->name); ++ if (exact_match(basename(nname),stripped_req)) + { + free(stripped_req); /* discard old pathname */ +- return (strdup(cmd->name)); ++ return (nname); + } ++ free(nname); + cmd++; + } + return (stripped_req);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902251337.x1PDbmSM063211>