/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-script

  • Committer: Teddy Hogeborn
  • Date: 2011-07-13 02:24:39 UTC
  • mfrom: (24.1.174 mandos)
  • Revision ID: teddy@fukt.bsnet.se-20110713022439-wbv6kghshdsc2x24
Merge from Björn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
# If we are connecting directly, run "configure_networking" (from
95
95
# /scripts/functions); it needs IPOPTS and DEVICE
96
96
if [ "${connect+set}" = set ]; then
97
 
    set +e                      # Required by library functions
98
97
    configure_networking
99
 
    set -e
100
98
    if [ -n "$connect" ]; then
101
99
        cat <<-EOF >>/conf/conf.d/mandos/plugin-runner.conf
102
100
        
110
108
 
111
109
# Our keyscript
112
110
mandos=/lib/mandos/plugin-runner
113
 
test -x "$mandos"
114
111
 
115
112
# parse /conf/conf.d/cryptroot.  Format:
116
113
# target=sda2_crypt,source=/dev/sda2,key=none,keyscript=/foo/bar/baz
152
149
else
153
150
    rm /conf/conf.d/cryptroot.mandos
154
151
fi
 
152
 
 
153
## Work around Debian bug #633582: <http://bugs.debian.org/633582>
 
154
# First determine the mandos user and group ID
 
155
mandos_user="65534"
 
156
mandos_group="65534"
 
157
while read line; do
 
158
    line="${line%%#*}"
 
159
    TEMP=`getopt --quiet --longoptions userid:,groupid: -- $line`
 
160
    eval set -- "$TEMP"
 
161
    while true; do
 
162
        case "$1" in
 
163
            --userid) mandos_user="$2"; shift 2;;
 
164
            --groupid) mandos_group="$2"; shift 2;;
 
165
            --) shift; break;;
 
166
        esac
 
167
    done
 
168
done < /conf/conf.d/mandos/plugin-runner.conf
 
169
chown "${mandos_user}:${mandos_group}" \
 
170
    /lib/mandos/plugins.d \
 
171
    /conf/conf.d/mandos/pubkey.txt \
 
172
    /conf/conf.d/mandos/seckey.txt