Browse Source

Give line printout along with line number.

OPENBSD_2_6
espie 25 years ago
parent
commit
bad13e3a6b
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/etc/security

+ 4
- 4
src/etc/security View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: security,v 1.31 1998/11/22 22:15:42 deraadt Exp $
# $OpenBSD: security,v 1.32 1999/06/19 17:14:31 espie Exp $
# from: @(#)security 8.1 (Berkeley) 6/9/93 # from: @(#)security 8.1 (Berkeley) 6/9/93
# #
@ -32,11 +32,11 @@ awk -F: '{
next; next;
} }
if (NF != 10) if (NF != 10)
printf("Line %d has the wrong number of fields.\n", NR);
printf("Line %d has the wrong number of fields:\n%s\n", NR, $0);
if ($1 ~ /^[+-]/) if ($1 ~ /^[+-]/)
next; next;
if ($1 == "") if ($1 == "")
printf("Line %d has an empty login field.\n", NR);
printf("Line %d has an empty login field:\n%s\n", NR, $0);
else if ($1 !~ /^[A-Za-z0-9][A-Za-z0-9_-]*$/) else if ($1 !~ /^[A-Za-z0-9][A-Za-z0-9_-]*$/)
printf("Login %s has non-alphanumeric characters.\n", $1); printf("Login %s has non-alphanumeric characters.\n", $1);
if (length($1) > 8) if (length($1) > 8)
@ -111,7 +111,7 @@ awk -F: '{
if ($1 ~ /^[+-].*$/) if ($1 ~ /^[+-].*$/)
next; next;
if (NF != 4) if (NF != 4)
printf("Line %d has the wrong number of fields.\n", NR);
printf("Line %d has the wrong number of fields:\n%s\n", NR, $0);
if ($1 !~ /^[A-za-z0-9][A-za-z0-9_-]*$/) if ($1 !~ /^[A-za-z0-9][A-za-z0-9_-]*$/)
printf("Group %s has non-alphanumeric characters.\n", $1); printf("Group %s has non-alphanumeric characters.\n", $1);
if (length($1) > 8) if (length($1) > 8)


Loading…
Cancel
Save