Skip to content
Snippets Groups Projects
Commit a2a1a74e authored by Guido Günther's avatar Guido Günther
Browse files

Don't fail chmod/chdir if a file doesn't exist

We don't use -f since we want to detect other errors (ro filesystem,
etc.)

Closes: #726203
parent 6aa2998e
No related branches found
No related tags found
No related merge requests found
......@@ -67,26 +67,26 @@ add_statoverrides()
for dir in ${ROOT_DIRS}; do
if ! dpkg-statoverride --list "${dir}" >/dev/null 2>&1; then
chown root:root "${dir}"
chmod 0711 "${dir}"
[ ! -e "${dir}" ] || chown root:root "${dir}"
[ ! -e "${dir}" ] || chmod 0711 "${dir}"
fi
done
for dir in ${QEMU_DIRS}; do
if ! dpkg-statoverride --list "${dir}" >/dev/null 2>&1; then
chown libvirt-qemu:libvirt-qemu "${dir}"
chmod 0750 "${dir}"
[ ! -e "${dir}" ] || chown libvirt-qemu:libvirt-qemu "${dir}"
[ ! -e "${dir}" ] || chmod 0750 "${dir}"
fi
done
if ! dpkg-statoverride --list "${SANLOCK_DIR}" >/dev/null 2>&1; then
chown root:root "${SANLOCK_DIR}"
chmod 0700 "${SANLOCK_DIR}"
[ ! -e "${dir}" ] || chown root:root "${SANLOCK_DIR}"
[ ! -e "${dir}" ] || chmod 0700 "${SANLOCK_DIR}"
fi
if ! dpkg-statoverride --list "${QEMU_CONF}" >/dev/null 2>&1; then
chown root:root "${QEMU_CONF}"
chmod 0600 "${QEMU_CONF}"
[ ! -e "${dir}" ] || chown root:root "${QEMU_CONF}"
[ ! -e "${dir}" ] || chmod 0600 "${QEMU_CONF}"
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment