security.d/chk_passwd

changeset 17
65656789da08
parent 14
59e07bba67cc
child 23
b66522a5726e
equal deleted inserted replaced
16:37f217a8bcce 17:65656789da08
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 ############################################################################# 3 #############################################################################
4 # Copyright (C) 2005-2012 4 # Copyright (C) 2005-2013
5 # 5 #
6 # Michiel Broek <mbse@mbse.eu> 6 # Michiel Broek <mbse at mbse.eu>
7 # Beekmansbos 10
8 # 1971 BV IJmuiden
9 # the Netherlands
10 # 7 #
11 # This file is part of SlackSecCheckScripts. 8 # This file is part of SlackSecCheckScripts.
12 # 9 #
13 # This package is free software; you can redistribute it and/or modify it 10 # This package is free software; you can redistribute it and/or modify it
14 # under the terms of the GNU General Public License as published by the 11 # under the terms of the GNU General Public License as published by the
100 printf "\tLogin %s has more than "len" characters.\n", $1; 97 printf "\tLogin %s has more than "len" characters.\n", $1;
101 if ($7 == "" && $8 !~ /!/ && $8 != "*") 98 if ($7 == "" && $8 !~ /!/ && $8 != "*")
102 printf "\tLogin %s does not have a shell\n", $1; 99 printf "\tLogin %s does not have a shell\n", $1;
103 if ($7 != "" && ! shells[$7] && $8 !~ /!/ && $8 != "*") 100 if ($7 != "" && ! shells[$7] && $8 !~ /!/ && $8 != "*")
104 printf "\tLogin %s does not have a valid shell (%s)\n", $1, $7; 101 printf "\tLogin %s does not have a valid shell (%s)\n", $1, $7;
105 if ($7 != "" && shells[$7] && ($8 ~ /!/ && $8 = "*")) 102 if ($7 != "" && shells[$7] && ($8 ~ /!/ && $8 = "*") && ($4 == 100))
106 printf "\tLogin %s account is locked.\n", $1; 103 printf "\tLogin %s account is locked.\n", $1;
107 if ($8 == "") 104 if ($8 == "")
108 printf "\tLogin %s has no password.\n", $1; 105 printf "\tLogin %s has no password.\n", $1;
109 if ($9 == "0") 106 if ($9 == "0")
110 printf "\tLogin %s password is expired.\n", $1; 107 printf "\tLogin %s password is expired.\n", $1;

mercurial