From 834b76700062784de8f2cec5bbbf6318fba39367 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 12 Aug 2019 11:43:49 +0200 Subject: [PATCH] [fix] Explicitly create home using mkhomedir_helper instead of obscure pam rule that doesn't work anymore --- debian/conf/pam/mkhomedir | 6 ------ debian/install | 1 - debian/postinst | 5 ----- src/yunohost/firewall.py | 6 +----- src/yunohost/user.py | 3 +-- 5 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 debian/conf/pam/mkhomedir diff --git a/debian/conf/pam/mkhomedir b/debian/conf/pam/mkhomedir deleted file mode 100644 index eedc8b745..000000000 --- a/debian/conf/pam/mkhomedir +++ /dev/null @@ -1,6 +0,0 @@ -Name: Create home directory during login -Default: yes -Priority: 900 -Session-Type: Additional -Session: - required pam_mkhomedir.so umask=0022 skel=/etc/skel diff --git a/debian/install b/debian/install index 777d7973e..1691a4849 100644 --- a/debian/install +++ b/debian/install @@ -13,7 +13,6 @@ data/other/* /usr/share/yunohost/yunohost-config/moulinette/ data/templates/* /usr/share/yunohost/templates/ data/helpers /usr/share/yunohost/ data/helpers.d/* /usr/share/yunohost/helpers.d/ -debian/conf/pam/* /usr/share/pam-configs/ lib/metronome/modules/* /usr/lib/metronome/modules/ locales/* /usr/lib/moulinette/yunohost/locales/ src/yunohost /usr/lib/moulinette diff --git a/debian/postinst b/debian/postinst index 9c78c8432..4b43b2506 100644 --- a/debian/postinst +++ b/debian/postinst @@ -29,11 +29,6 @@ do_configure() { # Yunoprompt systemctl enable yunoprompt.service - - # remove old PAM config and update it - [[ ! -f /usr/share/pam-configs/my_mkhomedir ]] \ - || rm /usr/share/pam-configs/my_mkhomedir - pam-auth-update --package } # summary of how this script can be called: diff --git a/src/yunohost/firewall.py b/src/yunohost/firewall.py index 9d209dbb8..4c3cfb0f7 100644 --- a/src/yunohost/firewall.py +++ b/src/yunohost/firewall.py @@ -26,11 +26,7 @@ import os import sys import yaml -try: - import miniupnpc -except ImportError: - sys.stderr.write('Error: Yunohost CLI Require miniupnpc lib\n') - sys.exit(1) +import miniupnpc from moulinette import m18n from yunohost.utils.error import YunohostError diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 7f8f2dc35..ed2a44670 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -208,8 +208,7 @@ def user_create(operation_logger, username, firstname, lastname, mail, password, try: # Attempt to create user home folder - subprocess.check_call( - ['su', '-', username, '-c', "''"]) + subprocess.check_call(["mkhomedir_helper", username]) except subprocess.CalledProcessError: if not os.path.isdir('/home/{0}'.format(username)): logger.warning(m18n.n('user_home_creation_failed'),