git: b6a573aa771e - main - dwatch(1): Use mdo(1) instead of sudo(8) when configured
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 07 Oct 2026 14:47:38 UTC
The branch main has been updated by 0mp:
URL: https://cgit.FreeBSD.org/src/commit/?id=b6a573aa771e4a4b239a7bfeb074d1d25e811c1b
commit b6a573aa771e4a4b239a7bfeb074d1d25e811c1b
Author: Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2026-10-06 14:02:42 +0000
Commit: Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2026-10-07 14:43:49 +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
---
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 8c201d970620..9dc13f87b555 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 July 4, 2026
+.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