Fri, 26 Dec 2014 11:43:45 +0100
Added a Makefile, version 0.22
5 | 1 | #!/bin/bash |
2 | # | |
3 | ############################################################################# | |
17
65656789da08
Removed uptime script, changed passwd test, minimized sensors output, bumped to version 0.18
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
4 | # Copyright (C) 2005-2013 |
5 | 5 | # |
17
65656789da08
Removed uptime script, changed passwd test, minimized sensors output, bumped to version 0.18
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
6 | # Michiel Broek <mbse at mbse.eu> |
5 | 7 | # |
14
59e07bba67cc
Fixed spelling error, updated address
Michiel Broek <mbse@mbse.eu>
parents:
5
diff
changeset
|
8 | # This file is part of SlackSecCheckScripts. |
5 | 9 | # |
10 | # This package is free software; you can redistribute it and/or modify it | |
11 | # under the terms of the GNU General Public License as published by the | |
12 | # Free Software Foundation; either version 2, or (at your option) any | |
13 | # later version. | |
14 | # | |
14
59e07bba67cc
Fixed spelling error, updated address
Michiel Broek <mbse@mbse.eu>
parents:
5
diff
changeset
|
15 | # SlackSecCheckScripts is distributed in the hope that it will be useful, but |
5 | 16 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | # General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with MBSE BBS; see the file COPYING. If not, write to the Free | |
22 | # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
23 | ############################################################################# | |
24 | ||
25 | ||
26 | PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
27 | ||
28 | umask 077 | |
29 | TZ=UTC; export TZ | |
30 | LANG=C; export LANG | |
31 | ||
32 | SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1 | |
33 | ||
34 | trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE | |
35 | ||
36 | if ! cd "$SECUREDIR"; then | |
37 | echo "Can not cd to $SECUREDIR". | |
38 | exit 1 | |
39 | fi | |
40 | ||
41 | OUTPUT=secure1.$$ | |
42 | ||
43 | # NFS exports shouldn't be globally exported | |
44 | # | |
45 | if [ -f /etc/exports ]; then | |
46 | cat /etc/exports | awk '{ | |
47 | # ignore comments and blank lines | |
48 | if ($0 ~ /^\#/ || $0 ~ /^$/ ) | |
49 | next; | |
50 | readwrite = 0; | |
51 | global = 0; | |
52 | for (i = 2; i <= NF; ++i) { | |
53 | if ($i ~ /*/) | |
54 | global = 1; | |
55 | if ($i ~ /rw/) | |
56 | readwrite = 1; | |
57 | } | |
58 | if (global) { | |
59 | if (readwrite) | |
60 | printf "\tFile system %s globally exported, read-write.\n", $1 | |
61 | else | |
62 | printf "\tFile system %s globally exported, read-only.\n", $1 | |
63 | } | |
64 | }' > $OUTPUT | |
65 | ||
66 | if [ -s $OUTPUT ] ; then | |
67 | printf "\nChecking for globally exported file nfs systems.\n" | |
68 | cat $OUTPUT | |
69 | fi | |
70 | fi | |
71 | ||
72 |