View | Details | Raw Unified | Return to bug 224511
Collapse All | Expand All

(-)Makefile (-2 / +2 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	logcheck
4
PORTNAME=	logcheck
5
PORTVERSION=	1.3.18
5
PORTVERSION=	1.3.18
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	security
7
CATEGORIES=	security
8
MASTER_SITES=	DEBIAN_POOL
8
MASTER_SITES=	DEBIAN_POOL
9
DISTNAME=	${PORTNAME}_${PORTVERSION}
9
DISTNAME=	${PORTNAME}_${PORTVERSION}
Lines 16-22 Link Here
16
16
17
BUILD_DEPENDS=	docbook-to-man>0:textproc/docbook-to-man
17
BUILD_DEPENDS=	docbook-to-man>0:textproc/docbook-to-man
18
RUN_DEPENDS=	mime-construct:mail/mime-construct \
18
RUN_DEPENDS=	mime-construct:mail/mime-construct \
19
		lockfile:mail/procmail \
19
		lockfile-create:sysutils/lockfile-progs \
20
		bash:shells/bash
20
		bash:shells/bash
21
21
22
LOGCHECK_USER=	logcheck
22
LOGCHECK_USER=	logcheck
(-)files/patch-src_logcheck (-74 / +16 lines)
Lines 1-6 Link Here
1
--- src/logcheck.orig	2017-07-11 17:32:13 UTC
1
--- src/logcheck.orig	2017-12-21 16:33:24 UTC
2
+++ src/logcheck
2
+++ src/logcheck
3
@@ -24,17 +24,10 @@
3
@@ -24,16 +24,16 @@
4
 
4
 
5
 if [ `id -u` = 0 ]; then
5
 if [ `id -u` = 0 ]; then
6
     echo "logcheck should not be run as root. Use su to invoke logcheck:"
6
     echo "logcheck should not be run as root. Use su to invoke logcheck:"
Lines 9-26 Link Here
9
     echo "Or use sudo: sudo -u logcheck logcheck${@:+ $@}."
9
     echo "Or use sudo: sudo -u logcheck logcheck${@:+ $@}."
10
     # you may want to uncomment that hack to let logcheck invoke itself.
10
     # you may want to uncomment that hack to let logcheck invoke itself.
11
-    # su -s /bin/bash -c "$0 $*" logcheck
11
-    # su -s /bin/bash -c "$0 $*" logcheck
12
-    exit 1
12
+    # su -s %%LOCALBASE%%/bin/bash -c "$0 $*" logcheck
13
-fi
13
     exit 1
14
-
14
 fi
15
 
15
-if [ ! -f /usr/bin/lockfile-create -o \
16
-if [ ! -f /usr/bin/lockfile-create -o \
16
-     ! -f /usr/bin/lockfile-remove -o \
17
-     ! -f /usr/bin/lockfile-remove -o \
17
-     ! -f /usr/bin/lockfile-touch ]; then
18
-     ! -f /usr/bin/lockfile-touch ]; then
18
-    echo "fatal: lockfile-progs is a prerequisite for logcheck, and was not found."
19
+if [ ! -f %%PREFIX%%/bin/lockfile-create -o \
19
+    # su -s %%LOCALBASE%%/bin/bash -c "$0 $*" logcheck
20
+     ! -f %%PREFIX%%/bin/lockfile-remove -o \
21
+     ! -f %%PREFIX%%/bin/lockfile-touch ]; then
22
     echo "fatal: lockfile-progs is a prerequisite for logcheck, and was not found."
20
     exit 1
23
     exit 1
21
 fi
24
 fi
22
 
25
@@ -69,13 +69,13 @@ EVENTSSUBJECT="System Events"
23
@@ -69,13 +62,13 @@ EVENTSSUBJECT="System Events"
24
 ADDTAG="no"
26
 ADDTAG="no"
25
 
27
 
26
 # Set the default paths
28
 # Set the default paths
Lines 41-47 Link Here
41
 CAT="/bin/cat"
43
 CAT="/bin/cat"
42
 SYSLOG_SUMMARY="/usr/bin/syslog-summary"
44
 SYSLOG_SUMMARY="/usr/bin/syslog-summary"
43
 
45
 
44
@@ -90,20 +83,15 @@ FQDN=0
46
@@ -90,7 +90,7 @@ FQDN=0
45
 SORTUNIQ=0
47
 SORTUNIQ=0
46
 SUPPORT_CRACKING_IGNORE=0
48
 SUPPORT_CRACKING_IGNORE=0
47
 SYSLOGSUMMARY=0
49
 SYSLOGSUMMARY=0
Lines 50-90 Link Here
50
 LOCKFILE="$LOCKDIR/logcheck"
52
 LOCKFILE="$LOCKDIR/logcheck"
51
 
53
 
52
 # Carry out the clean up tasks
54
 # Carry out the clean up tasks
53
 cleanup() {
55
@@ -171,7 +171,7 @@ $message
54
 
55
-    if [ -n "$LOCK" ]; then
56
-        debug "cleanup: Killing lockfile-touch - $LOCK"
57
-	kill "$LOCK" && unset LOCK
58
-    fi
59
-
60
-    if [ -f "$LOCKFILE.lock" ]; then
61
-        debug "cleanup: Removing lockfile: $LOCKFILE.lock"
62
-	lockfile-remove "$LOCKFILE"
63
+    if [ -f "$LOCKFILE" ]; then
64
+        debug "cleanup: Removing lockfile: $LOCKFILE"
65
+	rm -f "$LOCKFILE"
66
     fi
67
 
68
     if [ -d "$TMPDIR" ]; then
69
@@ -145,14 +133,9 @@ error() {
70
     if [ "$2" = "noclean" ]; then
71
 	debug "error: Not removing lockfile"
72
     else
73
-        if [ -n "$LOCK" ]; then
74
-	    debug "error: Killing lockfile-touch - $LOCK"
75
-	    kill "$LOCK" && unset LOCK
76
-	fi
77
-
78
-       if [ -f "$LOCKFILE.lock" ]; then
79
-           debug "error: Removing lockfile: $LOCKFILE.lock"
80
-           lockfile-remove "$LOCKFILE"
81
+       if [ -f "$LOCKFILE" ]; then
82
+           debug "error: Removing lockfile: $LOCKFILE"
83
+           rm -f "$LOCKFILE"
84
        fi
85
 
86
     fi
87
@@ -171,7 +154,7 @@ $message
88
 ${TMPDIR:+Check temporary directory: $TMPDIR
56
 ${TMPDIR:+Check temporary directory: $TMPDIR
89
 }
57
 }
90
 Also verify that the logcheck user can read all files referenced in
58
 Also verify that the logcheck user can read all files referenced in
Lines 93-99 Link Here
93
 
61
 
94
 $(export)
62
 $(export)
95
 EOF
63
 EOF
96
@@ -223,7 +206,7 @@ cleanrules() {
64
@@ -223,7 +223,7 @@ cleanrules() {
97
 			error "Couldn't read $x"
65
 			error "Couldn't read $x"
98
 		fi
66
 		fi
99
 	done
67
 	done
Lines 102-108 Link Here
102
 	    rulefile="$(basename "$rulefile")"
70
 	    rulefile="$(basename "$rulefile")"
103
 	    if [ -f "${dir}/${rulefile}" ]; then
71
 	    if [ -f "${dir}/${rulefile}" ]; then
104
 		debug "cleanrules: ${dir}/${rulefile}"
72
 		debug "cleanrules: ${dir}/${rulefile}"
105
@@ -538,9 +521,9 @@ fi
73
@@ -538,9 +538,9 @@ fi
106
 
74
 
107
 # Hostname either fully qualified or not.
75
 # Hostname either fully qualified or not.
108
 if [ "$FQDN" -eq 1 ]; then
76
 if [ "$FQDN" -eq 1 ]; then
Lines 114-148 Link Here
114
 fi
82
 fi
115
 
83
 
116
 # Now check for the other options
84
 # Now check for the other options
117
@@ -623,30 +606,25 @@ fi
85
@@ -645,8 +645,8 @@ else
118
 
119
 trap 'cleanup' 0
120
 
121
-debug "Trying to get lockfile: $LOCKFILE.lock"
122
+debug "Trying to get lockfile: $LOCKFILE"
123
 if [ ! -d "$LOCKDIR" ]; then
124
 	mkdir -m 0755 "$LOCKDIR"
125
 fi
86
 fi
126
-lockfile-create --retry 1 "$LOCKFILE" > /dev/null 2>&1
127
+lockfile -r 1 "$LOCKFILE" > /dev/null 2>&1
128
 
87
 
129
 
130
 if [ $? -eq 1 ]; then
131
     trap 0
132
-    if [ -e "${LOCKFILE}.lock" ]; then
133
+    if [ -e "${LOCKFILE}" ]; then
134
         error "Another logcheck process is still running" "noclean"
135
     else
136
-        error "Failed to get lockfile: $LOCKFILE.lock" "noclean"
137
+        error "Failed to get lockfile: $LOCKFILE" "noclean"
138
     fi
139
-
140
-else
141
-    debug "Running lockfile-touch $LOCKFILE.lock"
142
-    lockfile-touch "$LOCKFILE" &
143
-    LOCK="$!"
144
 fi
145
 
146
 # Create the secure temporary directory or exit
88
 # Create the secure temporary directory or exit
147
-TMPDIR="$(mktemp -d -p "${TMP:-/tmp}" logcheck.XXXXXX)" \
89
-TMPDIR="$(mktemp -d -p "${TMP:-/tmp}" logcheck.XXXXXX)" \
148
-    || TMPDIR="$(mktemp -d -p /var/tmp logcheck.XXXXXX)" \
90
-    || TMPDIR="$(mktemp -d -p /var/tmp logcheck.XXXXXX)" \

Return to bug 224511