From: Todd C. Miller Date: Thu, 14 Feb 2013 20:18:10 +0000 (-0500) Subject: Pass max_groups to plugin in settings list. X-Git-Tag: SUDO_1_8_7~1^2~231 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35548ae4e37a698ad533ca860af25d3282c7f5c4;p=sudo Pass max_groups to plugin in settings list. --- diff --git a/doc/sudo_plugin.cat b/doc/sudo_plugin.cat index c00f69646..431ef8463 100644 --- a/doc/sudo_plugin.cat +++ b/doc/sudo_plugin.cat @@ -149,6 +149,11 @@ DDEESSCCRRIIPPTTIIOONN Set to true if the user specified the --ii flag, indicating that the user wishes to run a login shell. + max_groups=int + The maximum number of groups a user may belong to. + This will only be present if there is a corresponding + setting in sudo.conf(4). + network_addrs=list A space-separated list of IP network addresses and netmasks in the form ``addr/netmask'', e.g. @@ -1363,6 +1368,8 @@ PPLLUUGGIINN AAPPII CCHHAANNGGEELLOOGG Support for the _e_x_e_c___b_a_c_k_g_r_o_u_n_d entry has been added to the command_info list. + The _m_a_x___g_r_o_u_p_s entry was added to the settings list. + The ssuuddoo front end now installs default signal handlers to trap common signals while the plugin functions are run. diff --git a/doc/sudo_plugin.man.in b/doc/sudo_plugin.man.in index 3fe04f916..99145e244 100644 --- a/doc/sudo_plugin.man.in +++ b/doc/sudo_plugin.man.in @@ -263,6 +263,11 @@ Set to true if the user specified the flag, indicating that the user wishes to run a login shell. .TP 6n +max_groups=int +The maximum number of groups a user may belong to. +This will only be present if there is a corresponding setting in +sudo.conf(@mansectform@). +.TP 6n network_addrs=list A space-separated list of IP network addresses and netmasks in the form @@ -2463,6 +2468,12 @@ entry has been added to the list. .sp The +\fImax_groups\fR +entry was added to the +\fRsettings\fR +list. +.sp +The \fBsudo\fR front end now installs default signal handlers to trap common signals while the plugin functions are run. diff --git a/doc/sudo_plugin.mdoc.in b/doc/sudo_plugin.mdoc.in index 55cb0907b..4e655a365 100644 --- a/doc/sudo_plugin.mdoc.in +++ b/doc/sudo_plugin.mdoc.in @@ -241,6 +241,10 @@ Set to true if the user specified the .Fl i flag, indicating that the user wishes to run a login shell. +.It max_groups=int +The maximum number of groups a user may belong to. +This will only be present if there is a corresponding setting in +.Xr sudo.conf @mansectform@ . .It network_addrs=list A space-separated list of IP network addresses and netmasks in the form @@ -2121,6 +2125,12 @@ entry has been added to the list. .Pp The +.Em max_groups +entry was added to the +.Li settings +list. +.Pp +The .Nm sudo front end now installs default signal handlers to trap common signals while the plugin functions are run. diff --git a/src/parse_args.c b/src/parse_args.c index 35e87a814..8e04ceb85 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -107,7 +107,9 @@ static struct sudo_settings { { "closefrom" }, #define ARG_NET_ADDRS 19 { "network_addrs" }, -#define NUM_SETTINGS 20 +#define ARG_MAX_GROUPS 20 + { "max_groups" }, +#define NUM_SETTINGS 21 { NULL } }; @@ -150,6 +152,13 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp, if (debug_flags != NULL) sudo_settings[ARG_DEBUG_FLAGS].value = debug_flags; + /* Set max_groups from sudo.conf. */ + i = sudo_conf_max_groups(); + if (i != -1) { + easprintf(&cp, "%d", i); + sudo_settings[ARG_MAX_GROUPS].value = cp; + } + /* Returns true if the last option string was "--" */ #define got_end_of_args (optind > 1 && argv[optind - 1][0] == '-' && \ argv[optind - 1][1] == '-' && argv[optind - 1][2] == '\0')