[fix] Explicitly create home using mkhomedir_helper instead of obscure pam rule that doesn't work anymore

This commit is contained in:
Alexandre Aubin 2019-08-12 11:43:49 +02:00
parent 8d5422d13f
commit 834b767000
5 changed files with 2 additions and 19 deletions

View file

@ -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

1
debian/install vendored
View file

@ -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

5
debian/postinst vendored
View file

@ -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:

View file

@ -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

View file

@ -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'),