1
0
mirror of synced 2026-04-15 07:39:46 +00:00

Also disable initctl in the chroot, not only start-stop-daemon

Closes LP#997063. Thanks xstasi on Lauchnpad for the patch
This commit is contained in:
Axel Beckert
2012-05-30 21:57:31 +02:00
parent 625a6f6282
commit 6201e24b51
2 changed files with 20 additions and 15 deletions

2
debian/changelog vendored
View File

@@ -23,6 +23,8 @@ xen-tools (4.3~dev-1) UNRELEASED; urgency=low
- No more expect at least one option to mkfs.* calls. Fixes btrfs
creation. (Closes: #609982)
- Fixes call to non-existent function logPrint (Closes: #673335)
- Also disable initctl in the chroot, not only start-stop-daemon
(LP: #997063; Thanks xstasi!)
* Add dependency on openssh-client for ssh-keygen (Closes: #649108)
* Use dh_auto_test for build time tests and add according
build-dependencies on devscripts and libfile-slurp-perl.

View File

@@ -121,14 +121,16 @@ disableStartStopDaemon ()
{
local prefix="$1"
assert "$LINENO" "${prefix}"
local daemonfile="${prefix}/sbin/start-stop-daemon"
for starter in start-stop-daemon initctl; do
local daemonfile="${prefix}/sbin/${starter}"
mv "${daemonfile}" "${daemonfile}.REAL"
echo '#!/bin/sh' > "${daemonfile}"
echo "echo \"Warning: Fake start-stop-daemon called, doing nothing\"" >> "${daemonfile}"
mv "${daemonfile}" "${daemonfile}.REAL"
echo '#!/bin/sh' > "${daemonfile}"
echo "echo \"Warning: Fake ${starter} called, doing nothing\"" >> "${daemonfile}"
chmod 755 "${daemonfile}"
logMessage "start-stop-daemon disabled / made a stub."
chmod 755 "${daemonfile}"
logMessage "${starter} disabled / made a stub."
done
}
@@ -140,16 +142,17 @@ enableStartStopDaemon ()
{
local prefix=$1
assert "$LINENO" "${prefix}"
local daemonfile="${prefix}/sbin/start-stop-daemon"
#
# If the disabled file is present then enable it.
#
if [ -e "${daemonfile}.REAL" ]; then
mv "${daemonfile}.REAL" "${daemonfile}"
logMessage "start-stop-daemon restored to working order."
fi
for starter in start-stop-daemon initctl; do
local daemonfile="${prefix}/sbin/${starter}"
#
# If the disabled file is present then enable it.
#
if [ -e "${daemonfile}.REAL" ]; then
mv "${daemonfile}.REAL" "${daemonfile}"
logMessage "${starter} restored to working order."
fi
done
}