Date: Tue, 28 Jul 2026 09:34:24 +0000 From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Ed Maste <emaste@FreeBSD.org> Subject: git: 44eb447094b7 - stable/14 - xinstall: Do not allow -l and -s together Message-ID: <6a6877a0.1c0e5.7a6adab7@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=44eb447094b7ddd181389f5fcb4fb0cae0fee957 commit 44eb447094b7ddd181389f5fcb4fb0cae0fee957 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2026-06-03 01:27:54 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2026-07-28 09:31:41 +0000 xinstall: Do not allow -l and -s together Cannot strip the target if creating a link. Reviewed by: des Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57398 (cherry picked from commit 521afce6a859c1d7ac9674e8f21ff45418becaf5) --- usr.bin/xinstall/tests/install_test.sh | 3 +++ usr.bin/xinstall/xinstall.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/usr.bin/xinstall/tests/install_test.sh b/usr.bin/xinstall/tests/install_test.sh index 6b091f26b377..377920200490 100755 --- a/usr.bin/xinstall/tests/install_test.sh +++ b/usr.bin/xinstall/tests/install_test.sh @@ -27,8 +27,11 @@ atf_test_case incompatible_opts incompatible_opts_body() { + printf 'test\n123\r456\r\n789\0z' >testf atf_check -s not-exit:0 -e match:"specified together" \ install -s -d dir1 + atf_check -s not-exit:0 -e match:"specified together" \ + install -s -l s testf copyf } atf_test_case copy_to_empty diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index a5173603d6ff..04801c590e06 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -294,6 +294,12 @@ main(int argc, char *argv[]) usage(); } + /* Cannot strip if creating a link. */ + if (dostrip && dolink) { + warnx("-l and -s may not be specified together"); + usage(); + } + /* * Default permissions based on whether we're a directory or not, since * an +X may mean that we need to set the execute bit.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6877a0.1c0e5.7a6adab7>
