From nobody Thu May 1 19:51:22 2025 X-Original-To: dev-commits-src-branches@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 4ZpPnR1Vx3z5vdtq; Thu, 01 May 2025 19:51:23 +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 4ZpPnQ61zBz46F0; Thu, 01 May 2025 19:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746129082; 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=q0jQkEV+bKTerjXMqExqZ0mnADtvItG3Xkf6ywqoMa0=; b=strF33visX0J3OEUJjz+d9Ek83vGuFy6SWzMJp2FxxvFkC0oPTjNXWOClH8YJv43M4EGTb qh87j/H1ZxEkfuhzvhaDDlswIUSgM7/44EVspRnu7KMv+OHO0VCzuSneWKmQx4CwZ+U/7K C0X9bCJYeKJAvbP9sghLhAS1LWbaDO01CaTRjcbaryQrYF6wt2UlbTgvJcxTn398gOSpMO AiNzbWn1rPBov0S2Q8eK2XamZl3dyzfER78Fey7quUj94K7qQdTpIaSPt09I9NwayE/+dp Ng10umlRqxmGMqHS9aHLw/jMJ82bPfeUKkWMuc1avAn/Ug1/kMGk5GUiN3VSSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746129082; 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=q0jQkEV+bKTerjXMqExqZ0mnADtvItG3Xkf6ywqoMa0=; b=UbEvWoPYraqm4bRhasVw2p0dYzicJgzre9yMIAl8ABomEnrIDaXWA+64+mJnv8L4efUsFC MK1yfxc9p4HdXeSmhXLzKAYvZlDSJJRENuNww/PIMRxGcBxiTx4n4/uJ4mLSkvQU/V2+y4 WYCBcJw4Fvm7ckubj+gE1kK23seqbW47P3X0uWYCm9oSaNbff4/iIf4cNg++5hH3m1Jhmc QaQUbtgflf4UmdLoVKuI9EsR9iuvUntH8PqWt24JO5h44Olb7JgKH+nQR52sb9r64wFzmn sS3RcHcRYXdFJJJTFy3S+RkAqtublc2hcIN5AwH6DI2XSUfrk7WBer/iJSI+Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1746129082; a=rsa-sha256; cv=none; b=pz682eCl2EcCCny0kCMe0GOThRClAh40RLWi9duQtpplqeR6xU238jPv78CFLv88mUcSdE lUbjFjfKMrYrw9d1uLmbM1cCz+RIipSIElrVsxRtRI2X/Da64ttPXF3vfZACxQq/VxhDID Tkb+YKJOmZahxs1k91RQ8CJZ+uZ8Ai9AMz2I6pb3Za7LXLAKz+sL5YKdhg4W+nbiV5oSdx PnF8wnDtfLrP+HxrR0Qi3NKQvgyzohr+EskJPvNHn+hPXY6si+gfm5Np9Smk7xm/FoHdCf SexgBCWj+jLwaVaM9Qnq/GL/mb/Z6NvG0BE0e2H/7QKx0u5Y9ADKEqp6o9svtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4ZpPnQ5HZBzhjF; Thu, 01 May 2025 19:51:22 +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 541JpMej067004; Thu, 1 May 2025 19:51:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 541JpMjf067001; Thu, 1 May 2025 19:51:22 GMT (envelope-from git) Date: Thu, 1 May 2025 19:51:22 GMT Message-Id: <202505011951.541JpMjf067001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 93ef18f9e83b - stable/14 - ps: handle incorrect -D values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 93ef18f9e83b15cfa3d844d9624462703caee381 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=93ef18f9e83b15cfa3d844d9624462703caee381 commit 93ef18f9e83b15cfa3d844d9624462703caee381 Author: Jamie Landeg-Jones AuthorDate: 2024-04-23 16:44:36 +0000 Commit: Olivier Certner CommitDate: 2025-05-01 19:35:07 +0000 ps: handle incorrect -D values I just noticed a slight issue with the '-D' option. Basically, I accidentally typed something along the lines of: ps -Dboth-p303 I.E. missing out the "space". Instead of giving an error, it behaved as if I'd just typed "ps". Looking at bin/ps/ps.c, where the -D option is parsed, it doesn't error-out if there is no valid match. This commit fixes the bug. (cherry picked from commit 3f0b80bc1537c257f3bd68592832ec8cb65e1c58) --- bin/ps/ps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 16d8a0a58d3c..897b4ccd9a92 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -276,6 +276,8 @@ main(int argc, char *argv[]) else if (len <= 4 && strncasecmp(optarg, "both", len) == 0) directions |= BOTH; + else + usage(); break; } case 'd':