/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-01-28 11:23:12 UTC
  • mto: This revision was merged to the branch mainline in revision 327.
  • Revision ID: teddy@fukt.bsnet.se-20090128112312-fccq15ef11z330u3
Start of new pipe-based IPC mechanism.

* mandos (TCP_handler.handle): Open the IPC pipe, write messages to it
                               and close it when done.
  (ForkingMixInWithPipe): New.
  (IPv6_TCPServer): Inherit from "ForkingMixInWithPipe" instead of
                   "SocketServer.ForkingMixIn".
  (IPv6_TCPServer.handle_ipc): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
                || getent passwd mandos \
56
56
                || getent passwd nobody \
57
57
                || echo ::65534::::; } \
58
 
        | cut --delimiter=: --fields=3 --only-delimited`"
 
58
        | awk --field-separator=: '{ print $3 }'`" 
59
59
mandos_group="`{ getent group _mandos \
60
60
                || getent group mandos \
61
61
                || getent group nogroup \
62
62
                || echo ::65534:; } \
63
 
        | cut --delimiter=: --fields=3 --only-delimited`"
 
63
        | awk --field-separator=: '{ print $3 }'`"
64
64
 
65
65
# The Mandos network client uses the network
66
66
auto_add_modules net
92
92
    fi
93
93
    case "$base" in
94
94
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
95
 
        */"*") echo "W: Mandos client plugin directory is empty." >&2 ;;
96
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
95
        "*") :;;
 
96
        *) copy_exec "$file" "${PLUGINDIR}";;
97
97
    esac
98
98
done
99
99
 
102
102
    base="`basename \"$file\"`"
103
103
    case "$base" in
104
104
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
105
 
        */"*") : ;;
106
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
105
        "*") :;;
 
106
        *) copy_exec "$file" "${PLUGINDIR}";;
107
107
    esac
108
108
done
109
109
 
124
124
 
125
125
if [ ${mandos_user} != 65534 ]; then
126
126
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
127
 
    cat <<-EOF >> "$PLUGINRUNNERCONF"
128
 
        
129
 
        --userid=${mandos_user}
130
 
EOF
 
127
    echo "--userid=${mandos_user}" >> "$PLUGINRUNNERCONF"
131
128
fi
132
129
 
133
130
if [ ${mandos_group} != 65534 ]; then
134
131
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
135
 
    cat <<-EOF >> "$PLUGINRUNNERCONF"
136
 
        
137
 
        --groupid=${mandos_group}
138
 
EOF
 
132
    echo "--groupid=${mandos_group}" >> "$PLUGINRUNNERCONF"
139
133
fi
140
134
 
141
135
# Key files 
142
 
for file in "$keydir"/*; do
 
136
for file in  "$keydir"/*; do
143
137
    if [ -d "$file" ]; then
144
138
        continue
145
139
    fi
174
168
        chmod a+rX "${DESTDIR}$dir"
175
169
    fi
176
170
done
177
 
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
178
 
    if [ -d "$dir" ]; then
179
 
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
180
 
            | xargs --null --no-run-if-empty chmod a+rX
181
 
    fi
 
171
for dir in /lib /usr/lib; do
 
172
    find "${DESTDIR}$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
173
        | xargs --null --no-run-if-empty chmod a+rX
182
174
done