From nobody Thu Jun 12 18:20:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ9n64vC0z5yC71; Thu, 12 Jun 2025 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ9n63fdMz3TnF; Thu, 12 Jun 2025 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jn+JdyEtB1R7MCsf9RyGOcy5W9EW/8L5x2ExHI5vEbs=; b=TFNoMkr0Smwcm/ZYoSO15BJ6qjnSDoySGqm2RMPVn+DpykHZ73TH8lJocSvKhOTkGQxHic hvm7FHcZKV7LL7LmYKkTyJzna928TsnVJGHSNuaNK/s4Zu8WF3MpaWHunjwIMUs8jBlwOJ yyMuoLNWsGnVsxMHiweTtRqlgEDVTdo/iPfl2jhbn80rXfMM2+kqlYknxEvLo8A52KXNT6 FGeYHBwSHezvo8gDzCtzM2Uo+ZGsfdbYXXhZsJB3XDM617NIc3REzY3cEwEZ0p1/Gc/6z7 Hh1zPfK7L1RZqd6s5zMg2DugxM3qiLBNssvMlTHaho4yO/BaoNbZI+pHWa5M1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jn+JdyEtB1R7MCsf9RyGOcy5W9EW/8L5x2ExHI5vEbs=; b=FUg2ewbuOHSNbi8uV1JAd42UBKlBv7MoNOjzX0jCtqwjpJ+/aGMJo/mq0HVSG/3o1c76cs ux6kkyN5E8wiXruyXUQEZ9XCK62WwmO4fIJ9mkTrD139T7YyROQLHipdVggWvrFRhjQldl JDh01D6ueac6Wp05VtpB4XVgewdAYQDn3+p1aK3txp6LYplFVkm18ixaHMbYrSb9D32xA1 k/onFv1V4vEcEqIRTalFY5LnTWI5ikL0xHWV5GyOhvHFkF5o8kmMUxFESmqxVbHYww/adJ gghfvtWKPRJjlHuDXEU2gP2hlx/g3APVj9Lw41uiqf+PqAQX2I7I0A/4yO0Rmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749752426; a=rsa-sha256; cv=none; b=LYSlC87eIMiIRJ9tyi4RP8v+Q4/Nx7xkEdbyJqTERPDKNVi+RxsDyvtas71UK6LTqbyhsb 2EjIi9BukGHZLE26sDKsbUj48hfK6W5eG/XB/NrZYXjMrlXjqtNJ9xScPg2jgN6xcDL59P DWSSQqLc6ljAdXy6s28karQ6QLXuGp0c/a/dggO+sYmej0sx9JBF/MLbO2+NWH5B+AoTKO SpJqFhokZhfSYdPG5VNkeOXkGOWpjOjT8XkIvoT7fXvy9/aA1CZx8RUMOuZsG7LefUOwkW meaplr2C2oOnMaZYO/og7wYK8luQqptMEPM/zAAMEZsyOOQtFN8LjeYIIgGC2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ9n62Wnzz7Xq; Thu, 12 Jun 2025 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CIKQ8h097368; Thu, 12 Jun 2025 18:20:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CIKQTQ097365; Thu, 12 Jun 2025 18:20:26 GMT (envelope-from git) Date: Thu, 12 Jun 2025 18:20:26 GMT Message-Id: <202506121820.55CIKQTQ097365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 4deb9760a9d8 - main - rc: Disable pathname expansion when calling run_rc_command() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4deb9760a9d84d5861ee45162ffebe83f13503b8 Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=4deb9760a9d84d5861ee45162ffebe83f13503b8 commit 4deb9760a9d84d5861ee45162ffebe83f13503b8 Author: Hiroki Sato AuthorDate: 2025-06-12 18:19:32 +0000 Commit: Hiroki Sato CommitDate: 2025-06-12 18:19:32 +0000 rc: Disable pathname expansion when calling run_rc_command() Variables for command-line options like $foo_flags can contain characters that perform pathname expansions, such as '[', ']', and '*'. They were passed without escaping, and the matched entries in the working directory affected the command-line options. This change turns off the expansion when run_rc_command() is called. While this changes the current behavior, an invocation of a service program should not depend on entries in the working directory. Differential Revision: https://reviews.freebsd.org/D45855 --- libexec/rc/rc.subr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 2eaf336b5220..359eebd1d342 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1788,7 +1788,11 @@ _run_rc_doit() debug "run_rc_command: doit: $*" _m=$(umask) ${_umask:+umask ${_umask}} + + # Disable pathname expansion temporarily for run_rc_command. + set -o noglob eval "$@" + set +o noglob _return=$? umask ${_m}