From nobody Tue Jan 30 11:42:10 2024 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 4TPNYv2L6Zz58hF4; Tue, 30 Jan 2024 11:42:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPNYv0SK2z4NNw; Tue, 30 Jan 2024 11:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614931; 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=k4u1NjYxbbfz2G1gFSpl94Uhfq8ij7e89TL92cYMhr4=; b=WxNonJNgBmifVaQFv5UrajGFl60umBeDoz4zKJoE33UtdFWrqRq61JXpCaAYNk4hMepI5b tHmJNj44E7dmECLcufoVXZUBKEoDQ1SGBF6jzkjKvOVN3XshhJLfSC2oC0tB77S0B+xgDB 7o3/yJSMifWML22NR/gm/2VcAEFbwAgehrDPdSn1vLwbeGQhGff0Whe2ipkuVX5IhxzeJs nXtKCAblzC21d4wveZgsC82FamVtT7F4HxcZkkt/IuYF2sGS0B8CXx3Gvxgsn/REbyt2I0 ZPZB7Tb+3Xa3W+HU2Yd2l/DYbNLsfVnC7fzGdR34gVM+Wta6qeaZ+OulduFwkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706614931; 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=k4u1NjYxbbfz2G1gFSpl94Uhfq8ij7e89TL92cYMhr4=; b=mmzgX+tmmRwlN9Kn96jYvg1v84kP+O6I3yPJdcerbuU2wcehijZwl8JoPhkmaCq8MI3o9P eZcPiqGjqE2Mb7MvaQp3H8TNy7hY7gGadLhCX2TOqTfd2y4yHAUBRNBh1YalWkOOWjVlCO 6dIja85kwe2deYgD/bw498yfwNlSNsjdgDmW4W8EAIuCS5IRJa4pLPZuFDNcQGDdH1a35z kKan2uOCqQxbQRQ1JbPLxufpFLdGdNYsP6l8wKi3zj36yMzF/RrV/ENcLQzOnZpaMn/bfP zddGuQ0mTvBIt3REmanlRml34gnlyCiSrDb5Bq8qSHbvlWN3cOZ9WzYCXeF9Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706614931; a=rsa-sha256; cv=none; b=FtwERElduLHpEgnUdUJa0hWRu9BPODeXOSQYN5f/ceUBNv/ADMT5cDfCQlgcVDiM1YHvgx J7ME+oSgzFWD3QyMGROPlJII1EgPU7vhoDAxPN5K6/jdVGVGUhAFD4Y8F1u84nfa6frN/n GXp47CB+yLBtjJe9p5eqkb6gNT550PmdJVCqIesSGfLszk+/2Q/c1VrUtECYO2yiihQSba xjfj9SShnApjO9sAoQ61//GQlkYy4RRfzTE6gVreQhcr8OSillrMAY2xUjgUKXpUFerET4 sjP5+oB/fBzIs0zoKU9ROI+CPnHEsvq1h2zDF4pKV0f7xWjjPfUiKACFL42cgQ== 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 4TPNYt6S8gzZtG; Tue, 30 Jan 2024 11:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40UBgAYb042323; Tue, 30 Jan 2024 11:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UBgAOb042320; Tue, 30 Jan 2024 11:42:10 GMT (envelope-from git) Date: Tue, 30 Jan 2024 11:42:10 GMT Message-Id: <202401301142.40UBgAOb042320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 128e78ffb084 - stable/14 - periodic: Make daily diff(1) output as small is possible 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 128e78ffb0847640ca5b411b4f55eb915d7ca15e Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=128e78ffb0847640ca5b411b4f55eb915d7ca15e commit 128e78ffb0847640ca5b411b4f55eb915d7ca15e Author: Michael Osipov AuthorDate: 2023-11-24 09:26:41 +0000 Commit: Michael Osipov CommitDate: 2024-01-30 11:41:38 +0000 periodic: Make daily diff(1) output as small is possible Make, by default, daily diff(1) ignore whitespace changes and the unified output a context of zero (0) lines. This reduces output of unrelated lines in e-mails delivered to root. PR: 270266 Approved by: jrm (mentor), karels MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D42762 (cherry picked from commit e2f6bafc3887c7752986526f3758525d24701fce) --- share/man/man5/periodic.conf.5 | 3 +++ usr.sbin/periodic/etc/daily/200.backup-passwd | 4 ++-- usr.sbin/periodic/etc/daily/210.backup-aliases | 2 +- usr.sbin/periodic/periodic.conf | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index da1eb355d7db..29fff146c212 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -644,6 +644,9 @@ All scripts must be absolute path names. Set to the arguments to pass to the .Xr diff 1 utility when generating differences. +The default is +.Fl b +.Fl U Cm 0 . .El .Pp The following variables are used by the standard scripts that reside in diff --git a/usr.sbin/periodic/etc/daily/200.backup-passwd b/usr.sbin/periodic/etc/daily/200.backup-passwd index e165e7f0f0ed..7cd52fc7be4b 100755 --- a/usr.sbin/periodic/etc/daily/200.backup-passwd +++ b/usr.sbin/periodic/etc/daily/200.backup-passwd @@ -40,7 +40,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" - diff ${daily_diff_flags:--u} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ + diff ${daily_diff_flags} -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ sed 's/^\([-+ ][^:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 @@ -57,7 +57,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host group diffs:" - diff ${daily_diff_flags:--u} $bak/group.bak /etc/group + diff ${daily_diff_flags} $bak/group.bak /etc/group mv $bak/group.bak $bak/group.bak2 cp -p /etc/group $bak/group.bak || rc=3 fi diff --git a/usr.sbin/periodic/etc/daily/210.backup-aliases b/usr.sbin/periodic/etc/daily/210.backup-aliases index 25e2bd021a84..d236d9615dba 100755 --- a/usr.sbin/periodic/etc/daily/210.backup-aliases +++ b/usr.sbin/periodic/etc/daily/210.backup-aliases @@ -34,7 +34,7 @@ case "$daily_backup_aliases_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host aliases diffs:" - diff ${daily_diff_flags:--u} $bak/aliases.bak /etc/mail/aliases + diff ${daily_diff_flags} $bak/aliases.bak /etc/mail/aliases mv $bak/aliases.bak $bak/aliases.bak2 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3 fi diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 0a8f7961c2f9..5e3a7837c6b4 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -31,7 +31,7 @@ anticongestion_sleeptime=3600 # that output. $daily_output might be set to /var/log/daily.log if you # wish to log the daily output and have the files rotated by newsyslog(8) # -daily_diff_flags="" # flags for diff output +daily_diff_flags="-b -U 0" # flags for diff output daily_output="root" # user or /file daily_show_success="YES" # scripts returning 0 daily_show_info="YES" # scripts returning 1