From 8028e1054a596077fe7b15d4c254c5d37289ebd6 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Fri, 21 Jul 2017 13:13:20 +0100 Subject: Drop need of root privileges to set root password These changes aim to avoid the requirement for root privileges when setting the password of root user on root file system. The "-R, --root" flag of chpasswd is using chroot to apply changes in root file system and this requires root privileges. [1] Instead compute hash of the root password using passlib [2] and insert the value in the /etc/shadow file in the rootfs. [1] https://en.wikipedia.org/wiki/Chroot#Limitations [2] http://passlib.readthedocs.io/en/stable/lib/passlib.hosts.html --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 70e3e03..36de2d5 100755 --- a/setup.py +++ b/setup.py @@ -112,6 +112,11 @@ setup( cmdclass={ 'pylint': CheckPylint }, + + # virt-bootstrap uses passlib to compute the hash of + # root password for root file system. + install_requires=['passlib>=1.6.1'], + extras_require={ 'dev': [ 'pylint', -- cgit