Commit 24dfddb1 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/sysklogd: fix logrotation script

the syslogd_listfiles didnt handle the --auth option properly.
We fix this and make it slightly more readable with -e

ref #408
(cherry picked from commit 6c890d6e)
parent 49446e9c
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sysklogd
pkgver=1.5
pkgrel=6
pkgrel=7
pkgdesc="System and kernel log daemons"
url="http://www.infodrom.org/projects/sysklogd/"
license="GPL BSD"
......@@ -48,7 +48,7 @@ build ()
}
md5sums="e053094e8103165f98ddafe828f6ae4b sysklogd-1.5.tar.gz
6bc1d1c65076b104a8f78d0fb4f21db7 sysklogd.logrotate
5ba669cf356796bdef20962a143eca72 sysklogd.daily
d66d2ad2c4d0905b42963af9e86edacb sysklogd.daily
e4c9a51499f1eb8d45dfdfe0d52737a5 sysklogd.initd
e25d7b583b7e4bd8be503b89e1771e90 sysklogd.confd
3b7ba3aa6519f96f11165a7d5900a8b1 sysklogd-1.4.2-caen-owl-klogd-drop-root.diff
......
......@@ -10,8 +10,8 @@ CONF="/etc/syslog.conf"
syslogd_listfiles() {
# List the target files from syslog.conf
local skip="auth"
[ "$1" = "--auth" ] && skip=" "
local skip=
[ "$1" = "--auth" ] && skip="!"
# the while loop joins lines that end in "\"
# the sed (in order)-
......@@ -19,14 +19,21 @@ syslogd_listfiles() {
# collapses spaces/tabs to 1 space;
# deletes the "-" in front of the filename;
# deletes whitespace before ';'
# deletes lines that have the "skip" facility
# deletes lines that have/dont have the "auth" facility
# deletes the facility (leaving just the filename)
# deletes lines that are not filenames with leading "/"
# print it
while read a ; do echo "$a"; done < $CONF |\
sed -n "/^[ \t]*#/D; /^[ \t]*$/D; s/[ \t]\+/ /g; \
s+ -/+ /+g; s/ *; */;/; /^.*\($skip\)[^ ]* /D; \
s/^[^ ]* //; /^[^\\/]/D; P" |\
sort | uniq
sed -n -e "s/\#.*//" \
-e "/^\s*$/D" \
-e "s/\s\+/ /g" \
-e "s: -/: /:g" \
-e "s/ *; */;/" \
-e "/^.*\(auth\)[^ ]* /${skip}D" \
-e "s:^.* /:/:" \
-e "/^[^\\/]/D" \
-e "P" \
| sort | uniq
}
# dumb little savelog - no error checking here
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment