NetBSD-Bugs archive

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

Re: PR/49031 CVS commit: src/etc/mtree



The following reply was made to PR bin/49031; it has been noted by GNATS.

From: Alan Barrett <apb%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: PR/49031 CVS commit: src/etc/mtree
Date: Tue, 5 Aug 2014 11:54:58 +0200

 --xXmbgvnjoT4axfJE
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Disposition: inline
 
 On Tue, 05 Aug 2014, David A. Holland wrote:
 > Log Message:
 > Remove "tags=nodiff" from /var/log/authlog as suggested by uebayasi@;
 > part of PR 49031.
 >
 > To generate a diff of this commit:
 > cvs rdiff -u -r1.147 -r1.148 src/etc/mtree/special
 
 I think that there were two underlying problems, and this commit
 works around one of them.
 
 The problems, as I see them, are:
 
 1. Tags in mtree files should be comma-separated, like
    "tags=exclude,nodiff".  /etc/mtree/special contains several
    lines with "tags=exclude tags=nodiff", and mtree(8) interprets
    that like "tags=nodiff", ignoring the attempt to set the "exclude"
    tag.
 
 2. /etc/security does not expect any files to have both "exclude" and
    "nodiff" tags, and is missing logic to handle that case.
 
 I attach a patch that I think will address both these problems.
 
 --apb (Alan Barrett)
 
 --xXmbgvnjoT4axfJE
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="pr49031.diff"
 
 Index: etc/security
 ===================================================================
 RCS file: /cvsroot/src/etc/security,v
 retrieving revision 1.115
 diff -d -p -u -r1.115 security
 --- etc/security       6 Nov 2013 19:37:05 -0000       1.115
 +++ etc/security       5 Aug 2014 09:45:12 -0000
 @@ -967,8 +967,13 @@ fi
  # List of files that get backed up and checked for any modifications.
  # Any changes cause the files to rotate.
  #
 +# Tags in mtree file $SPECIALSPEC modify the behaviour here:
 +# tags=exclude                - no backup, no diff.
 +# tags=nodiff         - do backup, do not diff.
 +# tags=exclude,nodiff - no backup, no diff (same as tags=exclude)
 +#
  if checkyesno check_changelist ; then
 -      mtree -D -k type -f $SPECIALSPEC -E exclude |
 +      mtree -D -k type -f $SPECIALSPEC -E exclude,nodiff |
            sed '/^type=file/!d ; s/type=file \.//' | unvis > $CHANGEFILES
  
        (
 @@ -1017,7 +1022,7 @@ fi
  # differences and we don't want to do that for these files
  #
  echo $MP > $TMP1                      # always add /etc/master.passwd
 -mtree -D -k type -f $SPECIALSPEC -I nodiff |
 +mtree -D -k type -f $SPECIALSPEC -I nodiff -E exclude |
      sed '/^type=file/!d ; s/type=file \.//' | unvis >> $TMP1
  grep -v '^$' $TMP1 | sort -u > $TMP2
  
 Index: etc/mtree/special
 ===================================================================
 RCS file: /cvsroot/src/etc/mtree/special,v
 retrieving revision 1.147
 diff -d -p -u -r1.147 special
 --- etc/mtree/special  19 May 2014 05:43:35 -0000      1.147
 +++ etc/mtree/special  5 Aug 2014 09:45:12 -0000
 @@ -8,9 +8,12 @@
  #
  # /etc/security checks:
  #     - All of these are checked if $check_mtree is enabled.
 -#     - Files with "nodiff" tags are highlighted if they change.
 +#     - Files without "exclude" tags are backed up in /var/backups.
 +#     - Files with "exclude" tags are not backed up.
  #     - Files without "nodiff" or "exclude" tags are displayed
  #       with diff(1)s if $check_changelist is enabled.
 +#     - Files with "nodiff" tags are highlighted if they change, but
 +#       diffs are not generated.
  #
  
  /set uname=root gname=wheel
 @@ -306,14 +309,14 @@
  ./etc/shells                  type=file mode=0644
  ./etc/shosts.equiv            type=file mode=0600 optional tags=nodiff
  ./etc/skel                    type=dir  mode=0755 optional
 -./etc/spwd.db                 type=file mode=0600 tags=exclude tags=nodiff
 +./etc/spwd.db                 type=file mode=0600 tags=exclude,nodiff
  ./etc/ssh                     type=dir  mode=0755 optional
  ./etc/ssh/ssh_config          type=file mode=0644 optional
  ./etc/ssh/ssh_host_dsa_key    type=file mode=0600 optional tags=nodiff
  ./etc/ssh/ssh_host_dsa_key.pub        type=file mode=0644 optional
  ./etc/ssh/ssh_host_ecdsa_key  type=file mode=0600 optional tags=nodiff
  ./etc/ssh/ssh_host_ecdsa_key.pub      type=file mode=0644 optional
 -./etc/ssh/ssh_host_key                type=file mode=0600 optional 
tags=nodiff tags=nodiff
 +./etc/ssh/ssh_host_key                type=file mode=0600 optional tags=nodiff
  ./etc/ssh/ssh_host_key.pub    type=file mode=0644 optional
  ./etc/ssh/ssh_host_rsa_key    type=file mode=0600 optional tags=nodiff
  ./etc/ssh/ssh_host_rsa_key.pub        type=file mode=0644 optional
 @@ -407,7 +410,7 @@
  ./var/cron/tabs/root          type=file mode=0600 tags=nodiff
  ./var/db                      type=dir  mode=0755
  ./var/log                     type=dir  mode=0755
 -./var/log/authlog             type=file mode=0600 optional tags=exclude 
tags=nodiff
 +./var/log/authlog             type=file mode=0600 optional tags=exclude,nodiff
  ./var/log/lastlog             type=file mode=0664 gname=utmp tags=exclude
  ./var/log/lastlogx            type=file mode=0664 gname=utmp tags=exclude
  ./var/log/wtmp                        type=file mode=0664 gname=utmp 
tags=exclude
 
 --xXmbgvnjoT4axfJE--
 


Home | Main Index | Thread Index | Old Index