git: ea13f1826da2 - stable/15 - dwatch(1): Use mdo(1) instead of sudo(8) when configured
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 15 Oct 2026 19:23:03 UTC
The branch stable/15 has been updated by 0mp:
URL: https://cgit.FreeBSD.org/src/commit/?id=ea13f1826da24b26065ef06c74bc48de72f1e33a
commit ea13f1826da24b26065ef06c74bc48de72f1e33a
Author: Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2026-10-06 14:02:42 +0000
Commit: Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2026-10-15 19:22:53 +0000
dwatch(1): Use mdo(1) instead of sudo(8) when configured
Reviewed by: dteske, olce
Approved by: christos (mentor)
MFC after: 1 week
Sponsored by: fme AG
Differential Revision: https://reviews.freebsd.org/D60408
(cherry picked from commit b6a573aa771e4a4b239a7bfeb074d1d25e811c1b)
---
cddl/usr.sbin/dwatch/dwatch | 3 ++-
cddl/usr.sbin/dwatch/dwatch.1 | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cddl/usr.sbin/dwatch/dwatch b/cddl/usr.sbin/dwatch/dwatch
index c9af8258f4ac..f3bdb3afe585 100755
--- a/cddl/usr.sbin/dwatch/dwatch
+++ b/cddl/usr.sbin/dwatch/dwatch
@@ -717,8 +717,9 @@ pproc_dump()
############################################################ MAIN
-# If we're running as root, no need for sudo(8)
+# If we're running as root, no need for mdo(1) or sudo(8)
[ "$( id -u )" != 0 ] && type sudo > /dev/null 2>&1 && SUDO=sudo
+[ "$( id -u )" != 0 ] && mdo true > /dev/null 2>&1 && SUDO=mdo
#
# Process command-line options
diff --git a/cddl/usr.sbin/dwatch/dwatch.1 b/cddl/usr.sbin/dwatch/dwatch.1
index 81efb2c2c437..02fefc6c4902 100644
--- a/cddl/usr.sbin/dwatch/dwatch.1
+++ b/cddl/usr.sbin/dwatch/dwatch.1
@@ -22,7 +22,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd April 18, 2025
+.Dd October 6, 2026
.Dt DWATCH 1
.Os
.Sh NAME
@@ -65,7 +65,9 @@ The
utility uses
.Xr dtrace 1
to display process info when a given DTrace probe point is triggered.
-Only the root user or users with
+Only the root user or users with either
+.Xr mdo 1
+or
.Xr sudo 8 Pq Pa ports/security/sudo
access can run this command.
.Pp