summaryrefslogtreecommitdiff
path: root/debian/patches/1000_configure_userns
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/1000_configure_userns')
-rw-r--r--debian/patches/1000_configure_userns74
1 files changed, 31 insertions, 43 deletions
diff --git a/debian/patches/1000_configure_userns b/debian/patches/1000_configure_userns
index a198cf9e..0cddc99d 100644
--- a/debian/patches/1000_configure_userns
+++ b/debian/patches/1000_configure_userns
@@ -1,8 +1,8 @@
=== modified file 'etc/login.defs'
-Index: shadow/etc/login.defs
+Index: git/etc/login.defs
===================================================================
---- shadow.orig/etc/login.defs 2014-02-16 19:31:38.934898148 -0500
-+++ shadow/etc/login.defs 2014-02-16 19:31:38.926898149 -0500
+--- git.orig/etc/login.defs
++++ git/etc/login.defs
@@ -229,7 +229,7 @@
# Extra per user uids
SUB_UID_MIN 100000
@@ -11,7 +11,7 @@ Index: shadow/etc/login.defs
+SUB_UID_COUNT 65536
#
- # Min/max values for automatic gid selection in groupadd
+ # Min/max values for automatic gid selection in groupadd(8)
@@ -242,7 +242,7 @@
# Extra per user group ids
SUB_GID_MIN 100000
@@ -20,27 +20,27 @@ Index: shadow/etc/login.defs
+SUB_GID_COUNT 65536
#
- # Max number of login retries if password is bad
-Index: shadow/src/newusers.c
+ # Max number of login(1) retries if password is bad
+Index: git/src/newusers.c
===================================================================
---- shadow.orig/src/newusers.c 2014-02-16 19:31:38.934898148 -0500
-+++ shadow/src/newusers.c 2014-02-16 19:31:38.926898149 -0500
-@@ -946,8 +946,8 @@
- #ifdef SHADOWGRP
+--- git.orig/src/newusers.c
++++ git/src/newusers.c
+@@ -988,8 +988,8 @@
is_shadow_grp = sgr_file_present ();
#endif
+ #ifdef ENABLE_SUBIDS
- is_sub_uid = sub_uid_file_present ();
- is_sub_gid = sub_gid_file_present ();
+ is_sub_uid = sub_uid_file_present () && !rflg;
+ is_sub_gid = sub_gid_file_present () && !rflg;
+ #endif /* ENABLE_SUBIDS */
open_files ();
-
-Index: shadow/src/useradd.c
+Index: git/src/useradd.c
===================================================================
---- shadow.orig/src/useradd.c 2014-02-16 19:31:38.934898148 -0500
-+++ shadow/src/useradd.c 2014-02-16 19:31:38.926898149 -0500
-@@ -1978,6 +1978,10 @@
+--- git.orig/src/useradd.c
++++ git/src/useradd.c
+@@ -1994,6 +1994,10 @@
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
@@ -51,55 +51,43 @@ Index: shadow/src/useradd.c
/*
* Get my name so that I can use it to report errors.
*/
-@@ -2001,18 +2005,20 @@
- */
- user_groups[0] = (char *) 0;
-
--
- is_shadow_pwd = spw_file_present ();
- #ifdef SHADOWGRP
+@@ -2023,9 +2027,10 @@
is_shadow_grp = sgr_file_present ();
#endif
+ #ifdef ENABLE_SUBIDS
- is_sub_uid = sub_uid_file_present ();
- is_sub_gid = sub_gid_file_present ();
--
-- get_defaults ();
-
- process_flags (argc, argv);
-
+-#endif /* ENABLE_SUBIDS */
+ is_sub_uid = sub_uid_file_present () && !rflg &&
+ (!user_id || (user_id <= uid_max && user_id >= uid_min));
+ is_sub_gid = sub_gid_file_present () && !rflg &&
+ (!user_id || (user_id <= uid_max && user_id >= uid_min));
-+
-+ get_defaults ();
-+
- #ifdef ACCT_TOOLS_SETUID
- #ifdef USE_PAM
- {
-Index: shadow/libmisc/find_new_sub_uids.c
+
+ get_defaults ();
+
+Index: git/libmisc/find_new_sub_uids.c
===================================================================
---- shadow.orig/libmisc/find_new_sub_uids.c 2014-02-16 19:31:38.934898148 -0500
-+++ shadow/libmisc/find_new_sub_uids.c 2014-02-16 19:31:38.926898149 -0500
-@@ -56,7 +56,7 @@
+--- git.orig/libmisc/find_new_sub_uids.c
++++ git/libmisc/find_new_sub_uids.c
+@@ -58,7 +58,7 @@
min = getdef_ulong ("SUB_UID_MIN", 100000UL);
max = getdef_ulong ("SUB_UID_MAX", 600100000UL);
- count = getdef_ulong ("SUB_UID_COUNT", 10000);
+ count = getdef_ulong ("SUB_UID_COUNT", 65536);
- if (min >= max || count >= max || (min + count) >= max) {
+ if (min > max || count >= max || (min + count - 1) > max) {
(void) fprintf (stderr,
-Index: shadow/libmisc/find_new_sub_gids.c
+Index: git/libmisc/find_new_sub_gids.c
===================================================================
---- shadow.orig/libmisc/find_new_sub_gids.c 2014-02-16 19:32:21.298896382 -0500
-+++ shadow/libmisc/find_new_sub_gids.c 2014-02-16 19:32:34.462895834 -0500
-@@ -56,7 +56,7 @@
+--- git.orig/libmisc/find_new_sub_gids.c
++++ git/libmisc/find_new_sub_gids.c
+@@ -58,7 +58,7 @@
min = getdef_ulong ("SUB_GID_MIN", 100000UL);
max = getdef_ulong ("SUB_GID_MAX", 600100000UL);
- count = getdef_ulong ("SUB_GID_COUNT", 10000);
+ count = getdef_ulong ("SUB_GID_COUNT", 65536);
- if (min >= max || count >= max || (min + count) >= max) {
+ if (min > max || count >= max || (min + count - 1) > max) {
(void) fprintf (stderr,