security.d/chk_dev

changeset 6
7f2c6e5ffee5
parent 5
fe3130d22800
equal deleted inserted replaced
5:fe3130d22800 6:7f2c6e5ffee5
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # $Id$
4 #
5 ############################################################################# 3 #############################################################################
6 # Copyright (C) 2006-2007 4 # Copyright (C) 2006-2009
7 # 5 #
8 # Michiel Broek <mbse@mbse.eu> 6 # Michiel Broek <mbse@mbse.eu>
9 # Beekmansbos 10 7 # Beekmansbos 10
10 # 1971 BV IJmuiden 8 # 1971 BV IJmuiden
11 # the Netherlands 9 # the Netherlands
51 TMP2=$SECUREDIR/tmp2 49 TMP2=$SECUREDIR/tmp2
52 TMP3=$SECUREDIR/tmp3 50 TMP3=$SECUREDIR/tmp3
53 51
54 if [ ! -f $CURR ]; then 52 if [ ! -f $CURR ]; then
55 # No database, install new database 53 # No database, install new database
56 find / \( -type b -o -type c \) -print0 2>/dev/null | xargs -0 /bin/ls -ldq --full-time | sort -k10 | egrep -v ptmx > $CURR 54 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
57 exit 55 exit
58 fi 56 fi
59 57
60 # Database is present, create temp database 58 # Database is present, create temp database
61 # 59 #
62 find / \( -type b -o -type c \) -print0 2>/dev/null | xargs -0 /bin/ls -ldq --full-time | sort -k10 | egrep -v ptmx > $TMP1 60 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
63 changed=0 61 changed=0
64 62
65 diff -b $TMP1 $CURR > $TMP2 63 diff -b $TMP1 $CURR > $TMP2
66 if [ -s $TMP2 ]; then 64 if [ -s $TMP2 ]; then
67 egrep '>' $TMP2 > $TMP3 65 egrep '>' $TMP2 > $TMP3

mercurial