/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: 2015-07-20 00:59:17 UTC
  • Revision ID: teddy@recompile.se-20150720005917-ud7fxa6wcv9y4ta6
mandos-client: Bug fix: don't crash if --dh-params was not used.

* plugins.d/mandos-client.c (main): Bug fix: Check if dh_params_file
                                    is NULL before using it in the
                                    workaround for Debian bug #633582.

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
    if [ -d "$file" ]; then
220
220
        continue
221
221
    fi
222
 
    cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}"
223
 
    chown ${mandos_user}:${mandos_group} \
224
 
        "${DESTDIR}${CONFDIR}/`basename \"$file\"`"
 
222
    case "$file" in
 
223
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
 
224
            : ;;
 
225
        "*") : ;;
 
226
        *)
 
227
            cp --archive --sparse=always "$file" \
 
228
               "${DESTDIR}${CONFDIR}"
 
229
            chown ${mandos_user}:${mandos_group} \
 
230
                  "${DESTDIR}${CONFDIR}/`basename \"$file\"`"
 
231
            ;;
 
232
    esac
225
233
done
 
234
# Use Diffie-Hellman parameters file if available
 
235
if [ -e "${DESTDIR}${CONFDIR}"/dhparams.pem ]; then
 
236
    sed --in-place \
 
237
        --expression="1i--options-for=mandos-client:--dh-params=${CONFDIR}/dhparams.pem" \
 
238
        "${DESTDIR}/${CONFDIR}/plugin-runner.conf"
 
239
fi
226
240
 
227
241
# /lib/mandos/plugin-runner will drop priviliges, but needs access to
228
242
# its plugin directory and its config file.  However, since almost all