|
|
46eb58 |
diff -up sudo-1.8.23/plugins/sudoers/cvtsudoers.c.legacy-group-processing sudo-1.8.23/plugins/sudoers/cvtsudoers.c
|
|
|
46eb58 |
--- sudo-1.8.23/plugins/sudoers/cvtsudoers.c.legacy-group-processing 2018-06-28 11:24:25.966475241 +0200
|
|
|
46eb58 |
+++ sudo-1.8.23/plugins/sudoers/cvtsudoers.c 2018-06-28 11:26:40.215025493 +0200
|
|
|
46eb58 |
@@ -321,6 +321,15 @@ main(int argc, char *argv[])
|
|
|
46eb58 |
sudo_fatalx("error: unhandled input %d", input_format);
|
|
|
46eb58 |
}
|
|
|
46eb58 |
|
|
|
46eb58 |
+ /*
|
|
|
46eb58 |
+ * cvtsudoers group filtering doesn't work if def_match_group_by_gid
|
|
|
46eb58 |
+ * is set to true by default (at compile-time). It cannot be set to false
|
|
|
46eb58 |
+ * because cvtsudoers doesn't apply the parsed Defaults.
|
|
|
46eb58 |
+ *
|
|
|
46eb58 |
+ * Related: sudo-1.8.23-legacy-group-processing.patch
|
|
|
46eb58 |
+ */
|
|
|
46eb58 |
+ def_match_group_by_gid = def_legacy_group_processing = false;
|
|
|
46eb58 |
+
|
|
|
46eb58 |
/* Apply filters. */
|
|
|
46eb58 |
filter_userspecs(conf);
|
|
|
46eb58 |
filter_defaults(conf);
|
|
|
46eb58 |
diff -up sudo-1.8.23/plugins/sudoers/defaults.c.legacy-group-processing sudo-1.8.23/plugins/sudoers/defaults.c
|
|
|
46eb58 |
--- sudo-1.8.23/plugins/sudoers/defaults.c.legacy-group-processing 2018-04-29 21:59:31.000000000 +0200
|
|
|
46eb58 |
+++ sudo-1.8.23/plugins/sudoers/defaults.c 2018-06-28 11:24:25.966475241 +0200
|
|
|
46eb58 |
@@ -87,6 +87,7 @@ static struct early_default early_defaul
|
|
|
46eb58 |
{ I_FQDN },
|
|
|
46eb58 |
#endif
|
|
|
46eb58 |
{ I_MATCH_GROUP_BY_GID },
|
|
|
46eb58 |
+ { I_LEGACY_GROUP_PROCESSING },
|
|
|
46eb58 |
{ I_GROUP_PLUGIN },
|
|
|
46eb58 |
{ I_RUNAS_DEFAULT },
|
|
|
46eb58 |
{ I_SUDOERS_LOCALE },
|
|
|
46eb58 |
@@ -488,6 +489,8 @@ init_defaults(void)
|
|
|
46eb58 |
}
|
|
|
46eb58 |
|
|
|
46eb58 |
/* First initialize the flags. */
|
|
|
46eb58 |
+ def_legacy_group_processing = true;
|
|
|
46eb58 |
+ def_match_group_by_gid = true;
|
|
|
46eb58 |
#ifdef LONG_OTP_PROMPT
|
|
|
46eb58 |
def_long_otp_prompt = true;
|
|
|
46eb58 |
#endif
|
|
|
46eb58 |
diff -up sudo-1.8.23/plugins/sudoers/def_data.c.legacy-group-processing sudo-1.8.23/plugins/sudoers/def_data.c
|
|
|
46eb58 |
--- sudo-1.8.23/plugins/sudoers/def_data.c.legacy-group-processing 2018-04-29 21:59:31.000000000 +0200
|
|
|
46eb58 |
+++ sudo-1.8.23/plugins/sudoers/def_data.c 2018-06-28 11:24:25.966475241 +0200
|
|
|
46eb58 |
@@ -494,6 +494,10 @@ struct sudo_defs_types sudo_defs_table[]
|
|
|
46eb58 |
N_("Ignore case when matching group names"),
|
|
|
46eb58 |
NULL,
|
|
|
46eb58 |
}, {
|
|
|
46eb58 |
+ "legacy_group_processing", T_FLAG,
|
|
|
46eb58 |
+ N_("Don't pre-resolve all group names"),
|
|
|
46eb58 |
+ NULL,
|
|
|
46eb58 |
+ }, {
|
|
|
46eb58 |
NULL, 0, NULL
|
|
|
46eb58 |
}
|
|
|
46eb58 |
};
|
|
|
46eb58 |
diff -up sudo-1.8.23/plugins/sudoers/def_data.h.legacy-group-processing sudo-1.8.23/plugins/sudoers/def_data.h
|
|
|
46eb58 |
--- sudo-1.8.23/plugins/sudoers/def_data.h.legacy-group-processing 2018-04-29 21:59:31.000000000 +0200
|
|
|
46eb58 |
+++ sudo-1.8.23/plugins/sudoers/def_data.h 2018-06-28 11:24:25.967475238 +0200
|
|
|
46eb58 |
@@ -226,6 +226,8 @@
|
|
|
46eb58 |
#define def_case_insensitive_user (sudo_defs_table[I_CASE_INSENSITIVE_USER].sd_un.flag)
|
|
|
46eb58 |
#define I_CASE_INSENSITIVE_GROUP 113
|
|
|
46eb58 |
#define def_case_insensitive_group (sudo_defs_table[I_CASE_INSENSITIVE_GROUP].sd_un.flag)
|
|
|
46eb58 |
+#define I_LEGACY_GROUP_PROCESSING 114
|
|
|
46eb58 |
+#define def_legacy_group_processing (sudo_defs_table[I_LEGACY_GROUP_PROCESSING].sd_un.flag)
|
|
|
46eb58 |
|
|
|
46eb58 |
enum def_tuple {
|
|
|
46eb58 |
never,
|
|
|
46eb58 |
diff -up sudo-1.8.23/plugins/sudoers/def_data.in.legacy-group-processing sudo-1.8.23/plugins/sudoers/def_data.in
|
|
|
46eb58 |
--- sudo-1.8.23/plugins/sudoers/def_data.in.legacy-group-processing 2018-04-29 21:59:31.000000000 +0200
|
|
|
46eb58 |
+++ sudo-1.8.23/plugins/sudoers/def_data.in 2018-06-28 11:24:25.967475238 +0200
|
|
|
46eb58 |
@@ -357,3 +357,6 @@ case_insensitive_user
|
|
|
46eb58 |
case_insensitive_group
|
|
|
46eb58 |
T_FLAG
|
|
|
46eb58 |
"Ignore case when matching group names"
|
|
|
46eb58 |
+legacy_group_processing
|
|
|
46eb58 |
+ T_FLAG
|
|
|
46eb58 |
+ "Don't pre-resolve all group names"
|
|
|
46eb58 |
diff -up sudo-1.8.23/plugins/sudoers/sudoers.c.legacy-group-processing sudo-1.8.23/plugins/sudoers/sudoers.c
|
|
|
46eb58 |
--- sudo-1.8.23/plugins/sudoers/sudoers.c.legacy-group-processing 2018-04-29 21:59:31.000000000 +0200
|
|
|
46eb58 |
+++ sudo-1.8.23/plugins/sudoers/sudoers.c 2018-06-28 11:24:25.967475238 +0200
|
|
|
46eb58 |
@@ -209,6 +209,10 @@ sudoers_policy_init(void *info, char * c
|
|
|
46eb58 |
if (set_loginclass(runas_pw ? runas_pw : sudo_user.pw))
|
|
|
46eb58 |
ret = true;
|
|
|
46eb58 |
|
|
|
46eb58 |
+ if (!def_match_group_by_gid || !def_legacy_group_processing) {
|
|
|
46eb58 |
+ def_match_group_by_gid = false;
|
|
|
46eb58 |
+ def_legacy_group_processing = false;
|
|
|
46eb58 |
+ }
|
|
|
46eb58 |
cleanup:
|
|
|
46eb58 |
if (!restore_perms())
|
|
|
46eb58 |
ret = -1;
|