diff -Nru shadow-4.8.1/debian/changelog shadow-4.8.1/debian/changelog --- shadow-4.8.1/debian/changelog 2021-06-17 21:35:15.000000000 +0200 +++ shadow-4.8.1/debian/changelog 2021-12-16 20:19:44.000000000 +0100 @@ -1,3 +1,10 @@ +shadow (1:4.8.1-1ubuntu9+mvo2) impish; urgency=medium + + * 1017_extrausers_group.patch: + - add usermod autodetection of extrausers on ubuntu-core + + -- Michael Vogt Thu, 16 Dec 2021 20:19:44 +0100 + shadow (1:4.8.1-1ubuntu9) impish; urgency=medium * Disallow purely numeric usernames. This includes hexadecimal and diff -Nru shadow-4.8.1/debian/patches/1017_extrausers_group.patch shadow-4.8.1/debian/patches/1017_extrausers_group.patch --- shadow-4.8.1/debian/patches/1017_extrausers_group.patch 1970-01-01 01:00:00.000000000 +0100 +++ shadow-4.8.1/debian/patches/1017_extrausers_group.patch 2021-12-16 20:19:44.000000000 +0100 @@ -0,0 +1,47 @@ +Index: shadow-4.8.1/src/usermod.c +=================================================================== +--- shadow-4.8.1.orig/src/usermod.c ++++ shadow-4.8.1/src/usermod.c +@@ -1636,6 +1636,12 @@ static void open_files (void) + * group entries. + */ + if (gr_lock () == 0) { ++ if (try_extrausers) { ++ gr_setdbname (EXTRAUSERS_GROUP_FILE); ++ sgr_setdbname (EXTRAUSERS_SHADOWGROUP_FILE); ++ open_files (); ++ return; ++ } + fprintf (stderr, + _("%s: cannot lock %s; try again later.\n"), + Prog, gr_dbname ()); +@@ -1643,6 +1649,14 @@ static void open_files (void) + } + gr_locked = true; + if (gr_open (O_CREAT | O_RDWR) == 0) { ++ if (try_extrausers) { ++ gr_unlock (); ++ gr_locked = false; ++ gr_setdbname (EXTRAUSERS_GROUP_FILE); ++ sgr_setdbname (EXTRAUSERS_SHADOWGROUP_FILE); ++ open_files (); ++ return; ++ } + fprintf (stderr, + _("%s: cannot open %s\n"), + Prog, gr_dbname ()); +@@ -1650,6 +1664,14 @@ static void open_files (void) + } + #ifdef SHADOWGRP + if (is_shadow_grp && (sgr_lock () == 0)) { ++ if (try_extrausers) { ++ gr_unlock (); ++ gr_locked = false; ++ gr_setdbname (EXTRAUSERS_GROUP_FILE); ++ sgr_setdbname (EXTRAUSERS_SHADOWGROUP_FILE); ++ open_files (); ++ return; ++ } + fprintf (stderr, + _("%s: cannot lock %s; try again later.\n"), + Prog, sgr_dbname ()); diff -Nru shadow-4.8.1/debian/patches/series shadow-4.8.1/debian/patches/series --- shadow-4.8.1/debian/patches/series 2020-12-02 11:44:02.000000000 +0100 +++ shadow-4.8.1/debian/patches/series 2021-12-16 20:09:56.000000000 +0100 @@ -21,3 +21,4 @@ 1014_extrausers_delgroup.patch 1015_add_zsys_support.patch 1016_extrausers_gpasswd.patch +1017_extrausers_group.patch