Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Use $diff_options when running diff in /etc/security.



details:   https://anonhg.NetBSD.org/src/rev/f6e279fb53c7
branches:  trunk
changeset: 543290:f6e279fb53c7
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Fri Feb 21 22:47:51 2003 +0000

description:
Use $diff_options when running diff in /etc/security.
Default diff_options to -u, for unified-format context diffs,
because context is essential to a useful evaluation of differences.
This represents a behavior change.

Implements change-request PR security/17247 from
Takahiro Kambe <taca%sky.yamashina.kyoto.jp@localhost>.

diffstat:

 etc/defaults/security.conf     |   3 ++-
 etc/security                   |   8 ++++----
 share/man/man5/security.conf.5 |  14 ++++++++++++--
 3 files changed, 18 insertions(+), 7 deletions(-)

diffs (94 lines):

diff -r 4cb6180caf6a -r f6e279fb53c7 etc/defaults/security.conf
--- a/etc/defaults/security.conf        Fri Feb 21 22:35:46 2003 +0000
+++ b/etc/defaults/security.conf        Fri Feb 21 22:47:51 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: security.conf,v 1.10 2003/02/13 02:42:07 jhawk Exp $
+#      $NetBSD: security.conf,v 1.11 2003/02/21 22:47:53 jhawk Exp $
 #
 # /etc/defaults/security.conf --
 #      default configuration of /etc/security.conf
@@ -26,6 +26,7 @@
 
 backup_dir=/var/backups
 backup_uses_rcs=YES
+diff_options=-u
 pkgdb_dir=/var/db/pkg
 
 check_mtree_follow_symlinks=NO
diff -r 4cb6180caf6a -r f6e279fb53c7 etc/security
--- a/etc/security      Fri Feb 21 22:35:46 2003 +0000
+++ b/etc/security      Fri Feb 21 22:47:51 2003 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#      $NetBSD: security,v 1.82 2003/02/13 02:42:06 jhawk Exp $
+#      $NetBSD: security,v 1.83 2003/02/21 22:47:51 jhawk Exp $
 #      from: @(#)security      8.1 (Berkeley) 6/9/93
 #
 
@@ -130,7 +130,7 @@
        if [ -f $_file ]; then
                if [ -f $CUR ] ; then
                        if [ "$_printdiff" -ne 0 ]; then
-                               diff $CUR $_file > $OUTPUT
+                               diff ${diff_options} $CUR $_file > $OUTPUT
                        else
                                if ! cmp -s $CUR $_file; then
                                        echo "[changes omitted]"
@@ -145,7 +145,7 @@
                else
                        printf "\n======\n%s added\n======\n" $_file
                        if [ "$_printdiff" -ne 0 ]; then
-                               diff /dev/null $_file
+                               diff ${diff_options} /dev/null $_file
                        else
                                echo "[changes omitted]"
                        fi
@@ -155,7 +155,7 @@
                if [ -f $CUR ]; then
                        printf "\n======\n%s removed\n======\n" $_file
                        if [ "$_printdiff" -ne 0 ]; then
-                               diff $CUR /dev/null
+                               diff ${diff_options} $CUR /dev/null
                        else
                                echo "[changes omitted]"
                        fi
diff -r 4cb6180caf6a -r f6e279fb53c7 share/man/man5/security.conf.5
--- a/share/man/man5/security.conf.5    Fri Feb 21 22:35:46 2003 +0000
+++ b/share/man/man5/security.conf.5    Fri Feb 21 22:47:51 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: security.conf.5,v 1.19 2003/02/13 02:42:37 jhawk Exp $
+.\"    $NetBSD: security.conf.5,v 1.20 2003/02/21 22:47:54 jhawk Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 12, 2003
+.Dd February 21, 2003
 .Dt SECURITY.CONF 5
 .Os
 .Sh NAME
@@ -192,6 +192,12 @@
 .It Sy backup_dir
 Change the backup directory from
 .Pa /var/backup .
+.It Sy diff_options
+Specify the options passed to
+.Xr diff 1
+when it is invoked to show changes made to system files. Defaults to
+.Dq -u ,
+for unified-format context-diffs.
 .It Sy pkgdb_dir
 Change the pkg database directory from
 .Pa /var/db/pkg
@@ -236,3 +242,7 @@
 .Sy check_pkgs
 features were added in
 .Nx 1.6 .
+.Sy diff_options
+appeared in
+.Nx 1.7 ;
+prior to that, traditional-format (context free) diffs were generated.



Home | Main Index | Thread Index | Old Index