/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

  • Committer: Teddy Hogeborn
  • Date: 2009-04-17 08:26:17 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090417082617-eltetak5lzjyz55o
* initramfs-tools-hook: Bug fix: Add "--userid" and "--groupid" to
                        start of "plugin-runner.conf" file instead of
                        appending, to allow any preexisting options to
                        override.
* plugin-runner.conf: Improved wording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
CONFDIR="/conf/conf.d/mandos"
69
69
MANDOSDIR="/lib/mandos"
70
70
PLUGINDIR="${MANDOSDIR}/plugins.d"
71
 
HOOKDIR="${MANDOSDIR}/network-hooks.d"
72
71
 
73
72
# Make directories
74
73
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
75
 
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}"
 
74
        "${DESTDIR}${MANDOSDIR}"
76
75
install --owner=${mandos_user} --group=${mandos_group} --directory \
77
76
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
78
77
 
91
90
    case "$base" in
92
91
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
93
92
            : ;;
94
 
        "*") echo "W: Mandos client plugin directory is empty." >&2 ;;
 
93
        */"*")
 
94
            echo "W: Mandos client plugin directory is empty." >&2 ;;
95
95
        *) copy_exec "$file" "${PLUGINDIR}" ;;
96
96
    esac
97
97
done
102
102
    case "$base" in
103
103
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
104
104
            : ;;
105
 
        "*") : ;;
 
105
        */"*") : ;;
106
106
        *) copy_exec "$file" "${PLUGINDIR}" ;;
107
107
    esac
108
108
done
109
109
 
110
 
# Copy network hooks
111
 
for hook in /etc/mandos/network-hooks.d/*; do
112
 
    case "`basename \"$hook\"`" in
113
 
        "*") continue ;;
114
 
        *[!A-Za-z0-9_.-]*) continue ;;
115
 
        *) test -d "$hook" || copy_exec "$hook" "${HOOKDIR}" ;;
116
 
    esac
117
 
    if [ -x "$hook" ]; then
118
 
        # Copy any files needed by the network hook
119
 
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
120
 
            VERBOSITY=0 "$hook" files | while read file target; do
121
 
            if [ -z "${target}" ]; then
122
 
                copy_exec "$file"
123
 
            else
124
 
                copy_exec "$file" "$target"
125
 
            fi
126
 
        done
127
 
        # Copy and load any modules needed by the network hook
128
 
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=modules \
129
 
            VERBOSITY=0 "$hook" modules | while read module; do
130
 
            if [ -z "${target}" ]; then
131
 
                force_load "$module"
132
 
            fi
133
 
        done
134
 
    fi
135
 
done
136
 
 
137
110
# GPGME needs /usr/bin/gpg
138
111
if [ ! -e "${DESTDIR}/usr/bin/gpg" \
139
112
    -a -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* \
142
115
fi
143
116
 
144
117
# Config files
145
 
for file in /etc/mandos/plugin-runner.conf; do
 
118
for file in /etc/mandos/*; do
146
119
    if [ -d "$file" ]; then
147
120
        continue
148
121
    fi
159
132
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
160
133
fi
161
134
 
162
 
# Key files
 
135
# Key files 
163
136
for file in "$keydir"/*; do
164
137
    if [ -d "$file" ]; then
165
138
        continue