Created attachment 202098 [details] Patch - use writable temp buffers for basename(3) calls In stable/12, basename(3) writes to its argument, which in scponly isn't a writable string, so it segfaults. Attached patch works around it. x-ref bug 235121 for similar behavior in rssh.
A commit references this bug: Author: garga Date: Mon Feb 25 13:37:49 UTC 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 Changes: head/shells/scponly/Makefile head/shells/scponly/files/patch-helper.c
Created attachment 202842 [details] Updated patch that works with FreeBSD 11.2 too The original patch may well work with FreeBSD 12, but it breaks under 11.2, possibly because the original patch returns the basename() of cmd->name, not the duplicate of it. This patch should work with both; only tested under 11.2 though.
A commit references this bug: Author: garga Date: Wed Mar 13 15:04:38 UTC 2019 New revision: 495579 URL: https://svnweb.freebsd.org/changeset/ports/495579 Log: shells/scponly: fix segfault on FreeBSD 11 Patch introduced in r493861 to fix segfault on FreeBSD 12+ broke it on FreeBSD 11. This new version fixes it on both versions. While here, pet portlint a bit moving USES to proper place and removing RUN_DEPENDS := BUILD_DEPENDS adding individual run depends where it's necessary. PR: 235810 Submitted by: Stewart Morgan <stewart.morgan@gmail.com> Sponsored by: Rubicon Communications, LLC (Netgate) Changes: head/shells/scponly/Makefile head/shells/scponly/files/patch-helper.c