Pass max_groups to plugin in settings list.

This commit is contained in:
Todd C. Miller
2013-02-14 15:18:10 -05:00
parent 67fed118b6
commit 35548ae4e3
4 changed files with 38 additions and 1 deletions

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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')