/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-10-03 09:32:30 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081003093230-rshn19e0c19zz12i
* .bzrignore (plugins.d/askpass-fifo): Added.

* Makefile (FORTIFY): Added "-fstack-protector-all".
  (mandos, mandos-keygen): Use more strict regexps when updating the
                           version number.

* mandos (Client.__init__): Use os.path.expandvars() and
                            os.path.expanduser() on the "secfile"
                            config value.

* plugins.d/splashy.c: Update comments and order of #include's.
  (main): Check user and group when looking for running splashy
          process.  Do not ignore ENOENT from execl().  Use _exit()
          instead of "return" when an error happens in child
          processes.  Bug fix: Only wait for splashy_update
          completion if it was started.  Bug fix: detect failing
          waitpid().  Only kill splashy_update if it is running.  Do
          the killing of the old splashy process before the fork().
          Do setsid() and setuid(geteuid()) before starting the new
          splashy.  Report failing execl().

* plugins.d/usplash.c: Update comments and order of #include's.
  (main): Check user and group when looking for running usplash
          process.  Do not report execv() error if interrupted by a
          signal.

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
 
        */"*")
94
 
            echo "W: Mandos client plugin directory is empty." >&2 ;;
95
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
92
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
93
        "*") :;;
 
94
        *) copy_exec "$file" "${PLUGINDIR}";;
96
95
    esac
97
96
done
98
97
 
100
99
for file in /etc/mandos/plugins.d/*; do
101
100
    base="`basename \"$file\"`"
102
101
    case "$base" in
103
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
104
 
            : ;;
105
 
        */"*") : ;;
106
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
102
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
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