Fixed join sorting, removed device checks

Mon, 20 Jul 2009 20:44:18 +0200

author
root@localhost
date
Mon, 20 Jul 2009 20:44:18 +0200
changeset 7
2c71590b2373
parent 6
7f2c6e5ffee5
child 8
5209729bbbac

Fixed join sorting, removed device checks

security.d/chk_dev file | annotate | diff | comparison | revisions
security.d/chk_passwd file | annotate | diff | comparison | revisions
--- a/security.d/chk_dev	Sat Jan 17 12:30:45 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-#############################################################################
-# Copyright (C) 2006-2009
-#   
-# Michiel Broek               <mbse@mbse.eu>
-# Beekmansbos 10
-# 1971 BV IJmuiden
-# the Netherlands
-#
-# This file is part of SlackSecCheckSripts.
-#
-# This package is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any
-# later version.
-#
-# SlackSecCheckSripts is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with MBSE BBS; see the file COPYING.  If not, write to the Free
-# Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-#############################################################################
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-
-umask 077
-TZ=UTC; export TZ
-LANG=C; export LANG
-
-SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1
-
-trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE
-
-if ! cd "$SECUREDIR"; then
-    echo "Can not cd to $SECUREDIR".
-    exit 1
-fi
-
-backup_dir=/var/cache/sscs
-mkdir -p "$backup_dir"
-
-CURR=${backup_dir}/dev.current
-BACK=${backup_dir}/dev.backup
-TMP1=$SECUREDIR/tmp1
-TMP2=$SECUREDIR/tmp2
-TMP3=$SECUREDIR/tmp3
-
-if [ ! -f $CURR ]; then
-    # No database, install new database
-    find / \( -type b -o -type c \) -print0 2>/dev/null | xargs -0 /bin/ls -ldq --full-time | sort -k10 | egrep -v ptmx | egrep -v pts | egrep -v usb > $CURR
-    exit
-fi
-
-# Database is present, create temp database
-#
-find / \( -type b -o -type c \) -print0 2>/dev/null | xargs -0 /bin/ls -ldq --full-time | sort -k10 | egrep -v ptmx | egrep -v pts | egrep -v usb > $TMP1
-changed=0
-
-diff -b $TMP1 $CURR > $TMP2
-if [ -s $TMP2 ]; then
-    egrep '>' $TMP2 > $TMP3
-    if [ -s $TMP3 ]; then
-	printf "\nOld or updated device files:\n"
-	cat $TMP3 | tr '>' ' '
-    fi
-    egrep '<' $TMP2 > $TMP3
-    if [ -s $TMP3 ]; then
-	printf "\nNew or updated device files:\n"
-	cat $TMP3 | tr '<' ' '
-    fi
-    changed=1
-fi
-
-
-# If changes were seen, update the database
-#
-if [ "$changed" == "1" ]; then
-    cat $CURR > $BACK
-    cat $TMP1 > $CURR
-fi
-
--- a/security.d/chk_passwd	Sat Jan 17 12:30:45 2009 +0100
+++ b/security.d/chk_passwd	Mon Jul 20 20:44:18 2009 +0200
@@ -1,11 +1,9 @@
 #!/bin/bash
 #
-# $Id$
-#
 #############################################################################
-# Copyright (C) 2005
+# Copyright (C) 2005-2009
 #   
-# Michiel Broek               <mbse@mbse.dds.nl>
+# Michiel Broek               <mbse@mbse.eu>
 # Beekmansbos 10
 # 1971 BV IJmuiden
 # the Netherlands
@@ -56,7 +54,7 @@
 
 # Combine passwd and shadow files.
 #
-join -t : -j 1 $MP $SP > $COMBINED
+join --nocheck-order -t : -j 1 $MP $SP > $COMBINED
 
 
 # These are used several times.

mercurial