From nobody Mon Sep 15 00:14:22 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 4cQ5Bl1vpVz67jBD; Mon, 15 Sep 2025 00:14:55 +0000 (UTC) (envelope-from dbaio@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQ5Bl0kYHz3bDC; Mon, 15 Sep 2025 00:14:55 +0000 (UTC) (envelope-from dbaio@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757895295; 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: in-reply-to:in-reply-to:references:references; bh=uC7YIZaIQoZh3b6e88J7RzaKpDeDLlK1rBXgayS8Aac=; b=HvrpTzAJVlTRlNTsE6SycwF8cLOIa8d3KQF0HkVhEWInv2yyjvN7ATCpp2lh+NNZDdIIq4 amh0backPEt71tyCBqXgOVucuBG0+QXXYvTL9KIzf/gK4VAP2y6vV0dvp54BRHqSfxw5Iv 3jH9orHr4BIISFGdeIjYGFhx8gu7wqKnv9xWmt/R8BKcVb6yhKpqVGmiTpSCANv31O5HmR l5vpF9UlVET3/fSiQB/Q4plPTP8thsMfpvf6gs6QbaUWocVTe9L0Tqpt3UuZ7fLH3Xk6oW lo7obU7rv9OlqoJfQ1soQIQuRFnqNW5xwuyfMOrmjdx3KTEgoSoLsdyF382WhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757895295; 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: in-reply-to:in-reply-to:references:references; bh=uC7YIZaIQoZh3b6e88J7RzaKpDeDLlK1rBXgayS8Aac=; b=LPiOHA/416g81/3vNsDEG34gxomuxDayiG5FA+ljfhObJgTvjKE+kzj+PIKPE/nWZlp1t0 xLpT1yvGpg8PNTo7Aljd5APLHVOwvjLxy+APGwh0GYRl7a7j57gt9uV6EDk+d0wvvTAzdU xbU0NgnY5eRfQG2fVKj2Jbh8bXlsHZpxfsvkVdEAfeX/HpqvirB2oiC0S1a9xdOcAUb6ns +s98W2s8t3dAk4O9XvivYSbADYJtPJGUsh5Qqr26QyB1vA3J7ndYhePw1OCyocw39gQcZ3 IzDeTWXWaMZyiyOzZLCj3ZLDIH223xsPj1h742VvUF5FZTBp4QU5lQ0i72DXeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757895295; a=rsa-sha256; cv=none; b=osxYJvplH/mS1ckoDMUzpxsDrtWUwvNdBARwDSo0697b+g5MW95Rxp/oCu2j9OSSUaPfJI 1QBWdpfSU9Y8s8JTRbXNsC0D7hXIjuGIkR6/fusC1D5cBDdVoz2zSRvm7KunlL6JHqfTd6 FDa/AFk4pXre/GRc/rMhLqirjlKIpAKyckowifdzlgwnDj+62n+XTafrEJ0jKHSus3/oBm PRzig/WGxXGErJJ0hGP8nHP9UEBSoxUC0B/yxdFc0ZA+TnglRxt6svrdUMPxJfaF2pKAgU cQFMQpLNWHKbCmSBJ79gBzXHU2g6y7NUtPi8Fcbwdrhb2T3aobaSNIg4QfF9Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com [103.168.172.201]) (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) (Authenticated sender: dbaio/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cQ5Bk6z96zpcc; Mon, 15 Sep 2025 00:14:54 +0000 (UTC) (envelope-from dbaio@freebsd.org) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.phl.internal (Postfix) with ESMTP id A78F2F40068; Sun, 14 Sep 2025 20:14:54 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-02.internal (MEProxy); Sun, 14 Sep 2025 20:14:54 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdefiedvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfffgrnhhilhho ucfirdcuuegrihhofdcuoegusggrihhosefhrhgvvgeuufffrdhorhhgqeenucggtffrrg htthgvrhhnpeehveefgeeihfekueeikeffvdehgedvuefhleeftdeggfdtvdeileffgfeg veehheenucffohhmrghinhepfhhrvggvsghsugdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegusggrihhoodhmvghsmhhtphgruhht hhhpvghrshhonhgrlhhithihqdduudekudefleduvddtqddvieektddvjeeikedquggsrg hioheppehfrhgvvggsshgurdhorhhgsehfrghsthhmrghilhdrtghomhdpnhgspghrtghp thhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggvvhdqtghomhhmih htshdqshhrtgdqrghllhesfhhrvggvsghsugdrohhrghdprhgtphhtthhopeguvghvqdgt ohhmmhhithhsqdhsrhgtqdhmrghinhesfhhrvggvsghsugdrohhrghdprhgtphhtthhope hkvghvrghnshesfhhrvggvsghsugdrohhrghdprhgtphhtthhopehsrhgtqdgtohhmmhhi thhtvghrshesfhhrvggvsghsugdrohhrgh X-ME-Proxy: Feedback-ID: i9d2946a4:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 776FD78026F; Sun, 14 Sep 2025 20:14:54 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface 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 X-ThreadId: Am1ynKg1lObs Date: Sun, 14 Sep 2025 21:14:22 -0300 From: "Danilo G. Baio" To: "Kyle Evans" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: <54e7f090-c031-47f2-bc51-c020a77ab00a@app.fastmail.com> In-Reply-To: <202507260314.56Q3E5cY002869@gitrepo.freebsd.org> References: <202507260314.56Q3E5cY002869@gitrepo.freebsd.org> Subject: Re: git: dbaaadd4373a - main - jls: minor simplification to arg handling Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, Jul 26, 2025, at 00:14, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=dbaaadd4373a725950ad11e578dab61537b7c4f2 > > commit dbaaadd4373a725950ad11e578dab61537b7c4f2 > Author: Kyle Evans > AuthorDate: 2025-07-26 03:13:41 +0000 > Commit: Kyle Evans > CommitDate: 2025-07-26 03:13:41 +0000 > > jls: minor simplification to arg handling > > It's easier to reason about the state of argc/argv if we just augment > them by optind after our getopt() loop. > > No functional change, but this sets the stage for another change to add > a `-c` mode to (c)heck for the existence of a jail quietly without > the caller having to worry about spurious output. > > Reviewed by: jamie > Differential Revision: https://reviews.freebsd.org/D51540 > --- > usr.sbin/jls/jls.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/usr.sbin/jls/jls.c b/usr.sbin/jls/jls.c > index bd193a69c458..a1d1716713aa 100644 > --- a/usr.sbin/jls/jls.c > +++ b/usr.sbin/jls/jls.c > @@ -140,8 +140,11 @@ main(int argc, char **argv) > ip4_ok = feature_present("inet"); > #endif > > + argc -= optind; > + argv += optind; > + > /* Add the parameters to print. */ > - if (optind == argc) { > + if (argc == 0) { > if (pflags & (PRINT_HEADER | PRINT_NAMEVAL)) > add_param("all", NULL, (size_t)0, NULL, JP_USER); > else if (pflags & PRINT_VERBOSE) { > @@ -179,9 +182,8 @@ main(int argc, char **argv) > } > } else { > pflags &= ~PRINT_VERBOSE; > - while (optind < argc) > - add_param(argv[optind++], NULL, (size_t)0, NULL, > - JP_USER); > + for (i = 0; i < argc; i++) > + add_param(argv[i], NULL, (size_t)0, NULL, JP_USER); > } > > if (pflags & PRINT_SKIP) { Hi, Just replying to one of the recent changes on `jls`. We use `jls -n` in many scripts, and recently, it stopped working. The last build that was working for us: FreeBSD 15.0-CURRENT #0 main-n278879-4be9c6f38e78: Sat Jul 19 13:19:25 UTC 2025 We are now encountering the following issue on this build: FreeBSD 16.0-CURRENT #0 main-n280141-5e82eeccd252: Sat Sep 6 05:27:34 UTC 2025 $ jls -n desc=0 devfs_ruleset=0 nodying enforce_statfs=0 env="" host=disable ip4=disable ip6=disable jid=0 meta="" name="" osreldate=0 osrelease="" parent=0 path="" nopersist securelevel=0 sysvmsg=disable sysvsem=disable sysvshm=disable vnet=disable zfs=disable allow.noadjtime allow.nochflags allow.noextattr allow.nomlock allow.nomount allow.mount.nodevfs allow.mount.nofdescfs allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets allow.noread_msgbuf allow.noreserved_ports allow.norouting allow.noset_hostname allow.nosettime allow.nosocket_af allow.nosuser allow.nosysvipc allow.nounprivileged_parent_tampering allow.nounprivileged_proc_debug children.cur=0 children.max=0 cpuset.id=0 host.domainname="" host.hostid=0 host.hostname="" host.hostuuid="" ip4.addr=0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0 ip4.nosaddrsel ip6.addr=::,::,::,::,::,:: ip6.nosaddrsel zfs.mount_snapshot=0 desc=0 devfs_ruleset=0 nodying enforce_statfs=0 env="" host=disable ip4=disable ip6=disable jid=0 meta="" name="" osreldate=0 osrelease="" parent=0 path="" nopersist securelevel=0 sysvmsg=disable sysvsem=disable sysvshm=disable vnet=disable zfs=disable allow.noadjtime allow.nochflags allow.noextattr allow.nomlock allow.nomount allow.mount.nodevfs allow.mount.nofdescfs allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets allow.noread_msgbuf allow.noreserved_ports allow.norouting allow.noset_hostname allow.nosettime allow.nosocket_af allow.nosuser allow.nosysvipc allow.nounprivileged_parent_tampering allow.nounprivileged_proc_debug children.cur=0 children.max=0 cpuset.id=0 host.domainname="" host.hostid=0 host.hostname="" host.hostuuid="" ip4.addr=0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0 ip4.nosaddrsel ip6.addr=::,::,::,::,::,:: ip6.nosaddrsel zfs.mount_snapshot=0 desc=0 devfs_ruleset=0 nodying enforce_statfs=0 env="" host=disable ip4=disable ip6=disable jid=0 meta="" name="" osreldate=0 osrelease="" parent=0 path="" nopersist securelevel=0 sysvmsg=disable sysvsem=disable sysvshm=disable vnet=disable zfs=disable allow.noadjtime allow.nochflags allow.noextattr allow.nomlock allow.nomount allow.mount.nodevfs allow.mount.nofdescfs allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets allow.noread_msgbuf allow.noreserved_ports allow.norouting allow.noset_hostname allow.nosettime [...] infinite loop -- Danilo G. Baio