/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-11-08 17:26:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081108172635-6eexzbysvsk4bu1z
* mandos: Also import "with_statement" and "absolute_import" from
          "__future__.  Import "closing" from "contextlib".
  (Client.__init__): Use "with closing" on "secfile".
  (Client.checker_callback): Call "self.bump_timeout()" instead of
                             doing it directly.
  (Client.bump_timeout): New method to bump up the timeout.
  (TCP_handler.handle): Simplify code to provide fallback default for
                        GnuTLS priority string.
  (IPv6_TCPServer): Do not inherit from
                    "SocketServer.ForkingTCPServer", since that is
                    undocumented - instead, follow the example code
                    from the documentation.
  (if_nametoindex): Use "with closing" on the socket.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    exit 1
52
52
fi
53
53
 
54
 
mandos_user="`{ getent passwd _mandos \
55
 
                || getent passwd mandos \
 
54
mandos_user="`{ getent passwd mandos \
56
55
                || getent passwd nobody \
57
56
                || echo ::65534::::; } \
58
 
        | cut --delimiter=: --fields=3 --only-delimited`"
59
 
mandos_group="`{ getent group _mandos \
60
 
                || getent group mandos \
 
57
        | awk --field-separator=: '{ print $3 }'`" 
 
58
mandos_group="`{ getent group mandos \
61
59
                || getent group nogroup \
62
60
                || echo ::65534:; } \
63
 
        | cut --delimiter=: --fields=3 --only-delimited`"
 
61
        | awk --field-separator=: '{ print $3 }'`"
64
62
 
65
63
# The Mandos network client uses the network
66
64
auto_add_modules net
92
90
    fi
93
91
    case "$base" in
94
92
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
95
 
        "*") : ;;
96
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
93
        "*") :;;
 
94
        *) copy_exec "$file" "${PLUGINDIR}";;
97
95
    esac
98
96
done
99
97
 
102
100
    base="`basename \"$file\"`"
103
101
    case "$base" in
104
102
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
105
 
        "*") : ;;
106
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
103
        "*") :;;
 
104
        *) copy_exec "$file" "${PLUGINDIR}";;
107
105
    esac
108
106
done
109
107
 
124
122
 
125
123
if [ ${mandos_user} != 65534 ]; then
126
124
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
127
 
    cat <<-EOF >> "$PLUGINRUNNERCONF"
128
 
        
129
 
        --userid=${mandos_user}
130
 
EOF
 
125
    echo "--userid=${mandos_user}" >> "$PLUGINRUNNERCONF"
131
126
fi
132
127
 
133
128
if [ ${mandos_group} != 65534 ]; then
134
129
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
135
 
    cat <<-EOF >> "$PLUGINRUNNERCONF"
136
 
        
137
 
        --groupid=${mandos_group}
138
 
EOF
 
130
    echo "--groupid=${mandos_group}" >> "$PLUGINRUNNERCONF"
139
131
fi
140
132
 
141
133
# Key files 
142
 
for file in "$keydir"/*; do
 
134
for file in  "$keydir"/*; do
143
135
    if [ -d "$file" ]; then
144
136
        continue
145
137
    fi
174
166
        chmod a+rX "${DESTDIR}$dir"
175
167
    fi
176
168
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
 
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
182
172
done