File: nginx-common.config

package info (click to toggle)
nginx 1.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 9,472 kB
  • sloc: ansic: 169,389; sh: 613; perl: 439; python: 240; makefile: 126; cpp: 19
file content (36 lines) | stat: -rwxr-xr-x 712 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

set -e

. /usr/share/debconf/confmodule

logdir="/var/log/nginx"

log_symlinks_check() {
    # Skip new installations
    [ -z "$1" ] && return

    # Skip unaffected installations
    dpkg --compare-versions "$1" lt-nl "1.10.2-1~" || return 0

    # Check for unsecure symlinks
    linked_logfiles="` find "$logdir" -type l -user www-data -name '*.log' `"

    # Skip if nothing is found
    [ -z "$linked_logfiles" ] && return

    db_subst nginx/log-symlinks logfiles $linked_logfiles
    db_input high nginx/log-symlinks || true
    db_go || true
}

case "$1" in
    configure|reconfigure)
        log_symlinks_check "$2"
        ;;
    *)
        ;;
esac

# vim: set ts=4 sts=4 sw=4 et sta ai :