From aaabf8c75c993030ef3056f2aba7e87d55278a4b Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 9 Apr 2020 17:37:04 +0200 Subject: [PATCH 1/4] [fix] also invalidate group cache --- src/yunohost/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 69baf4435..ee3504135 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -213,8 +213,9 @@ def user_create(operation_logger, username, firstname, lastname, mail, password, except Exception as e: raise YunohostError('user_creation_failed', user=username, error=e) - # Invalidate passwd to take user creation into account + # Invalidate passwd and group to take user and group creation into account subprocess.call(['nscd', '-i', 'passwd']) + subprocess.call(['nscd', '-i', 'group']) try: # Attempt to create user home folder From f03bb82aadd1d16226cafdad9581390c0a866799 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 12 Apr 2020 01:57:56 +0200 Subject: [PATCH 2/4] Make sure we have at least the standard stuff in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/snap/bin:/var/lib/snapd/snap/bin:/snap/bin:/var/lib/snapd/snap/bin ~.~ --- bin/yunohost | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/yunohost b/bin/yunohost index 10a21a9da..b640c8c52 100755 --- a/bin/yunohost +++ b/bin/yunohost @@ -179,6 +179,10 @@ def _retrieve_namespaces(): ret.append(n) return ret +# Stupid PATH management because sometimes (e.g. some cron job) PATH is only /usr/bin:/bin ... +default_path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +if os.environ["PATH"] != default_path: + os.environ["PATH"] = default_path + ":" + os.environ["PATH"] # Main action ---------------------------------------------------------- From 0c9a4509f765a60cc6f2840c243b8abb1c09a676 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 10 Apr 2020 23:44:13 +0200 Subject: [PATCH 3/4] [fix] lxc uid number is limited to 65536 by default --- src/yunohost/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yunohost/user.py b/src/yunohost/user.py index ee3504135..df0527655 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -170,7 +170,8 @@ def user_create(operation_logger, username, firstname, lastname, mail, password, uid_guid_found = False while not uid_guid_found: - uid = str(random.randint(200, 99999)) + # LXC uid number is limited to 65536 by default + uid = str(random.randint(200, 65000)) uid_guid_found = uid not in all_uid and uid not in all_gid # Adapt values for LDAP From 37fd69653a13e7cd90c61df8fbb52580d143f776 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 12 Apr 2020 23:14:07 +0200 Subject: [PATCH 4/4] Update changelog for 3.7.1.1 --- debian/changelog | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 018807b16..6245bb4b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +yunohost (3.7.1.1) stable; urgency=low + + - [fix] lxc uid number is limited to 65536 by default (0c9a4509) + - [fix] also invalidate group cache when creating users (aaabf8c7) + - [fix] Make sure to have a path that include sbin for stupid cron jobs (f03bb82a) + + -- Alexandre Aubin Sun, 12 Apr 2020 23:15:00 +0000 + yunohost (3.7.1) stable; urgency=low - [enh] Add ynh_permission_has_user helper (#905) @@ -13,7 +21,7 @@ yunohost (3.7.1) stable; urgency=low Thanks to all contributors <3 ! (Bram, Kay0u, Maniack, Matthew D.) - -- Alexandre Aubin Thu, 9 April 2020 14:52:00 +0000 + -- Alexandre Aubin Thu, 9 Apr 2020 14:52:00 +0000 yunohost (3.7.0.12) stable; urgency=low