/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: 2008-09-26 04:54:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080926045435-0thnnqops1kzclag
* debian/mandos-client.postinst: Change home directory to
                                 "/nonexistent".
* debian/mandos.postinst: - '' -

* plugin-runner.c (main): Bug fix: Block signals while modifying
                          "plugin_list".

* plugins.d/usplash.c (usplash_write): New function.
  (main): Use "usplash_write" to write "INPUTQUIET" command.  Also
          write "TIMEOUT 0" before it, and write "TIMEOUT 15" and
          "PULSATE" if starting a new usplash process.  Kill old
          usplash before forking.  Bug fix: do setuid(geteuid()) to
          preserve genuine rootness.  Better interrupted/error logic
          overall.

* debian/mandos-client.lintian-overrides: Ignore setuid
                                          "plugins.d/usplash".

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    exit 1
52
52
fi
53
53
 
54
 
set `{ getent passwd _mandos \
55
 
    || getent passwd nobody \
56
 
    || echo ::65534:65534:::; } \
57
 
    | cut --delimiter=: --fields=3,4 --only-delimited \
58
 
    --output-delimiter=" "`
59
 
mandos_user="$1"
60
 
mandos_group="$2"
 
54
mandos_user="`{ getent passwd mandos \
 
55
                || getent passwd nobody \
 
56
                || echo ::65534::::; } \
 
57
        | awk --field-separator=: '{ print $3 }'`" 
 
58
mandos_group="`{ getent group mandos \
 
59
                || getent group nogroup \
 
60
                || echo ::65534:; } \
 
61
        | awk --field-separator=: '{ print $3 }'`"
61
62
 
62
63
# The Mandos network client uses the network
63
64
auto_add_modules net
88
89
        continue
89
90
    fi
90
91
    case "$base" in
91
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
92
 
            : ;;
93
 
        "*") echo "W: Mandos client plugin directory is empty." >&2 ;;
94
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
92
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
93
        "*") :;;
 
94
        *) copy_exec "$file" "${PLUGINDIR}";;
95
95
    esac
96
96
done
97
97
 
99
99
for file in /etc/mandos/plugins.d/*; do
100
100
    base="`basename \"$file\"`"
101
101
    case "$base" in
102
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
103
 
            : ;;
104
 
        "*") : ;;
105
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
102
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
103
        "*") :;;
 
104
        *) copy_exec "$file" "${PLUGINDIR}";;
106
105
    esac
107
106
done
108
107
 
122
121
done
123
122
 
124
123
if [ ${mandos_user} != 65534 ]; then
125
 
    sed --in-place --expression="1i--userid=${mandos_user}" \
126
 
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
124
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
125
    echo "--userid=${mandos_user}" >> "$PLUGINRUNNERCONF"
127
126
fi
128
127
 
129
128
if [ ${mandos_group} != 65534 ]; then
130
 
    sed --in-place --expression="1i--groupid=${mandos_group}" \
131
 
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
129
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
130
    echo "--groupid=${mandos_group}" >> "$PLUGINRUNNERCONF"
132
131
fi
133
132
 
134
133
# Key files 
135
 
for file in "$keydir"/*; do
 
134
for file in  "$keydir"/*; do
136
135
    if [ -d "$file" ]; then
137
136
        continue
138
137
    fi
167
166
        chmod a+rX "${DESTDIR}$dir"
168
167
    fi
169
168
done
170
 
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
171
 
    if [ -d "$dir" ]; then
172
 
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
173
 
            | xargs --null --no-run-if-empty chmod a+rX
174
 
    fi
 
169
for dir in /lib /usr/lib; do
 
170
    find "${DESTDIR}$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
171
        | xargs --null --no-run-if-empty chmod a+rX
175
172
done