diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | vpn/svpnsh | 10 |
2 files changed, 9 insertions, 5 deletions
@@ -1,2 +1,6 @@ | |||
1 | 2009-08-03 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * vpn/svpnsh: Fix concurrent login recognition. | ||
4 | |||
1 | 2009-03-19 Sergey Poznyakoff <gray@gnu.org.ua> | 5 | 2009-03-19 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 6 | ||
@@ -1,5 +1,5 @@ | |||
1 | #! /bin/sh | 1 | #! /bin/sh |
2 | # svpnsh -- a simple vpn-only shell | 2 | # svpnsh -- a simple vpn-only shell |
3 | # Copyright (C) 2007 Sergey Poznyakoff | 3 | # Copyright (C) 2007, 2009 Sergey Poznyakoff |
4 | # | 4 | # |
5 | # This program is free software; you can redistribute it and/or modify | 5 | # This program is free software; you can redistribute it and/or modify |
@@ -21,5 +21,5 @@ logmsg() { | |||
21 | prio=$1 | 21 | prio=$1 |
22 | shift | 22 | shift |
23 | /usr/bin/logger -t vpnsh -p auth.$prio $* | 23 | /usr/bin/logger -t svpnsh -p auth.$prio $* |
24 | } | 24 | } |
25 | 25 | ||
@@ -31,7 +31,7 @@ if [ -z "$PAIR" ]; then | |||
31 | fi | 31 | fi |
32 | 32 | ||
33 | NLOGINS=`who -q | sed '2,$d' | tr ' ' '\n' | sort | sed '1d' | uniq -c | | 33 | sdup=`who -q | sed '/^#/d' | tr -s ' ' '\n' | sort | uniq -d | grep "$USER"` |
34 | awk "\\$2==\"$USER\" { print \\$1 }"` | 34 | |
35 | if [ ${NLOGINS:-0} -gt 1 ] | 35 | if [ -n "$sdup" ] |
36 | then | 36 | then |
37 | logmsg notice "$USER: too many concurrent logins" | 37 | logmsg notice "$USER: too many concurrent logins" |