updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / lockout / crontab.patch
blob880dd476dea3791ab411797eb8de861086a72b60
1 diff -rupN old/etc/cron.d/lockout new/etc/cron.d/lockout
2 --- old/etc/cron.d/lockout 2010-12-31 16:32:35.000000000 +0800
3 +++ new/etc/cron.d/lockout 2010-12-31 16:31:00.000000000 +0800
4 @@ -1,5 +1,5 @@
5 # lockout needs to check every minute whether it's time to unlock
6 -*/1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1
7 +*/1 * * * * sh -c "/usr/bin/lockout unlock" >/dev/null 2>&1
9 # rebooting *MUST* restore the root password
10 -@reboot root /usr/bin/lockout unlock force >/dev/null 2>&1
11 +@reboot sh -c "/usr/bin/lockout unlock force" >/dev/null 2>&1
12 diff -rupN old/usr/bin/lockout new/usr/bin/lockout
13 --- old/usr/bin/lockout 2010-12-31 16:25:13.000000000 +0800
14 +++ new/usr/bin/lockout 2010-12-31 16:30:31.000000000 +0800
15 @@ -87,8 +87,8 @@ be unlocked.
17 /etc/cron.d/lockout B<must> contain the following two entries:
19 - */1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1
20 - @reboot root /usr/bin/lockout unlock force >/dev/null 2>&1
21 + */1 * * * * sh -c "/usr/bin/lockout unlock" >/dev/null 2>&1
22 + @reboot sh -c "/usr/bin/lockout unlock force" >/dev/null 2>&1
24 The examples that follow assume you are using L<sudo(8)> and you have a file,
25 F</etc/lockout/sudoers.normal> which is the normal F</etc/sudoers> file, and
26 @@ -201,8 +201,8 @@ Thomer M. Gil, http://thomer.com/lockout
27 # # NB: do not remove! removing these entries will cause lockout to fail,
28 # # which means that you may end up not knowing your root password.
29 # #
30 -# */1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1
31 -# @reboot root /usr/bin/lockout unlock force >/dev/null 2>&1
32 +# */1 * * * * sh -c "/usr/bin/lockout unlock" >/dev/null 2>&1
33 +# @reboot sh -c "/usr/bin/lockout unlock force" >/dev/null 2>&1
34 # ---------------------------------------------------------------------
35 # (Or whatever the correct path to lockout is.)
37 @@ -260,8 +260,8 @@ sub lock {
38 my ($unlock, $unlock_force) = (0, 0);
39 while(<CRONTAB>) {
40 my $valid = 0;
41 - /^\s*\*\/1\s+\*\s+\*\s+\*\s+\*\s+root\s+(\S+)\s+unlock\s*.*$/ and $valid = $unlock = 1;
42 - /^\s*\@reboot\s+root\s+(\S+)\s+unlock\s+force\s*.*$/ and $valid = $unlock_force = 1;
43 + /^\s*\*\/1\s+\*\s+\*\s+\*\s+\*\s+sh\s+-c\s+"(\S+)\s+unlock"/ and $valid = $unlock = 1;
44 + /^\s*\@reboot\s+sh\s+-c\s+"(\S+)\s+unlock\s+force"/ and $valid = $unlock_force = 1;
46 if($valid) {
47 -x $1 or print "$1 does not exist or is not executable. run 'crontab -u root -e'\n" and exit -1;
48 @@ -273,8 +273,8 @@ sub lock {
49 print <<EOF;
50 Your $CRONTAB should contain:
52 -/1 * * * * root /usr/bin/lockout unlock
53 -\@reboot root /usr/bin/lockout unlock force
54 +*/1 * * * * sh -c "/usr/bin/lockout unlock" >/dev/null 2>&1
55 +\@reboot sh -c "/usr/bin/lockout unlock force" >/dev/null 2>&1
56 EOF
57 exit -1;
59 @@ -555,8 +555,8 @@ FILES
60 $UNLOCK_SCRIPT -- script executed on unlock
61 $CRONTAB -- this file must contain:
62 ----------------------------------------------------------------
63 - */1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1
64 - \@reboot root /usr/bin/lockout unlock force >/dev/null 2>&1
65 + */1 * * * * sh -c "/usr/bin/lockout unlock" >/dev/null 2>&1
66 + \@reboot sh -c "/usr/bin/lockout unlock force" >/dev/null 2>&1
67 ----------------------------------------------------------------
68 (or another, correct path to lockout)