core-agent-linux/debian/qubes-core-agent-passwordless-root.postrm
Marek Marczykowski-Górecki 43fba4e94a
debian: do not add user to sudo group, lock root account
The qubes-core-agent-passwordless-root package ships sudo configuration,
adding to sudo group isn't needed.

Basically revert all changes made by qubes-core-agent-passwordless-root
installation.

Fixes QubesOS/qubes-issues#4015
2018-09-02 07:05:06 +02:00

55 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# postrm script for core-agent-linux
#
# see: dh_installdeb(1)
set -e
# The prerm script may be called in the following ways:
# * <postrm> 'remove'
# * <postrm> 'purge'
# * <old-postrm> 'upgrade' <new-version>
# * <disappearer's-postrm> 'disappear' <overwriter> <overwriter-version>
#
# The postrm script is called after the package's files have been removed
# or replaced. The package whose postrm is being called may have previously been
# deconfigured and only be "Unpacked", at which point subsequent package changes
# do not consider its dependencies. Therefore, all postrm actions may only rely
# on essential packages and must gracefully skip any actions that require the
# package's dependencies if those dependencies are unavailable.[48]
#
# * <new-postrm> 'failed-upgrade' <old-version>
#
# Called when the old postrm upgrade action fails. The new package will be
# unpacked, but only essential packages and pre-dependencies can be relied on.
# Pre-dependencies will either be configured or will be "Unpacked" or
# "Half-Configured" but previously had been configured and was never removed.
#
# * <new-postrm> 'abort-install'
# * <new-postrm> 'abort-install' <old-version>
# * <new-postrm> 'abort-upgrade' <old-version>
#
# Called before unpacking the new package as part of the error handling of
# preinst failures. May assume the same state as preinst can assume.
#
# For details, see http://www.debian.org/doc/debian-policy/ or
# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
# the debian-policy package
if [ "${1}" = "remove" ] ; then
gpasswd -d user sudo
if [ "$(passwd -S root|cut -f 2 -d ' ')" = "NP" ]; then
passwd -l root
fi
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
# vim: set ts=4 sw=4 sts=4 et :