~ubuntu-branches/debian/sid/bugzilla/sid

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Copyright (C) 2009  Raphael Bossek <bossekr@debian.org>

set -e

setacl()
{
    u="$1"
    g="$2"
    m="$3"
    shift 3
    for f in $*; do
        if ! dpkg-statoverride --list "$f" >/dev/null 2>&1; then
            dpkg-statoverride --update --add "$u" "$g" "$m" "$f"
        fi
    done
}

setacld()
{
    u="$1"
    g="$2"
    m="$3"
    shift 3
    for d in $*; do
        for p in `find "$d" -type d`; do
            setacl "$u" "$g" "$m" "$p"
        done
    done
}

setaclf()
{
    u="$1"
    g="$2"
    m="$3"
    shift 3
    for d in $*; do
        for p in `find "$d" -type f`; do
            setacl "$u" "$g" "$m" "$p"
	    done
    done
}

setacl "root" "www-data" 0775 "$BUGZILLA_ETCDIR" "$BUGZILLA_ETCDIR/sites"
setacl "root" "www-data" 0660 "$BUGZILLA_ETCDIR"/params
setacl "root" "www-data" 0660 "$BUGZILLA_ETCDIR"/localconfig
setacl "root" "root" 0600 "$BUGZILLA_ETCDIR"/dbconfig-params
setacl "root" "www-data" 0644 "$BUGZILLA_ETCDIR"/index.html

setacl "root" "www-data" 0775 "$BUGZILLA_DATADIR" "$BUGZILLA_DATADIR"/attachments "$BUGZILLA_DATADIR"/duplicates "$BUGZILLA_DATADIR"/mining "$BUGZILLA_DATADIR"/template "$BUGZILLA_DATADIR"/webdot

# It's a really time consuming action to manage access rights for all files
# and directories with dpkg-statoverride e.g. for the $BUGZILLA_VARDIR/template.
#setacld "root" "www-data" 0755 "$BUGZILLA_VARDIR"/template
#setaclf "root" "www-data" 0644 "$BUGZILLA_VARDIR"/template
#
# As workarround we make some assumtions:
# 1) All directories get the same user/group and mode as "$BUGZILLA_VARDIR"/tempalte
# 2) All files gets the same same user/group and mode as "$BUGZILLA_VARDIR"/template/en/default/index.html.tmpl
#
# Check post-checksetup.p/15restoredpkgstatoverride how this will be achived.
setacl "root" "www-data" 0755 "$BUGZILLA_VARDIR"/template
setacl "root" "www-data" 0644 "$BUGZILLA_VARDIR"/template/en/default/index.html.tmpl
 
setacld "root" "www-data" 0755 "$BUGZILLA_WEBDIR"/skins
setaclf "root" "www-data" 0644 "$BUGZILLA_WEBDIR"/skins