}
static char *
-berval_iter(void *base, void **save)
+berval_iter(void **vp)
{
- struct berval **bv;
+ struct berval **bv = *vp;
- bv = *save ? *save : base;
- *save = bv + 1;
+ *vp = bv + 1;
return *bv ? (*bv)->bv_val : NULL;
}
{
struct member_list *members;
struct member *m;
- void *save = NULL;
char *val;
debug_decl(bv_to_member_list, SUDOERS_DEBUG_LDAP)
return NULL;
TAILQ_INIT(members);
- while ((val = iter(a, &save)) != NULL) {
+ while ((val = iter(&a)) != NULL) {
if ((m = calloc(1, sizeof(*m))) == NULL)
goto bad;
struct sudo_command *c;
struct privilege *priv;
struct member *m;
- void *cmnds_save = NULL;
char *cmnd;
debug_decl(sudo_ldap_role_to_priv, SUDOERS_DEBUG_LDAP)
/*
* Parse sudoCommands and add to cmndlist.
*/
- while ((cmnd = iter(cmnds, &cmnds_save)) != NULL) {
+ while ((cmnd = iter(&cmnds)) != NULL) {
char *args;
/* Allocate storage upfront. */
/* Parse sudoOptions. */
if (opts != NULL) {
- void *opts_save = NULL;
char *opt;
- while ((opt = iter(opts, &opts_save)) != NULL) {
+ while ((opt = iter(&opts)) != NULL) {
char *var, *val;
int op;
}
static char *
-val_array_iter(void *base, void **save)
+val_array_iter(void **vp)
{
- char **val_array;
+ char **val_array = *vp;
- val_array = *save ? *save : base;
- *save = val_array + 1;
+ *vp = val_array + 1;
return *val_array;
}
#ifndef SUDOERS_LDAP_H
#define SUDOERS_LDAP_H
-typedef char * (*sudo_ldap_iter_t)(void *, void **);
+typedef char * (*sudo_ldap_iter_t)(void **);
bool sudo_ldap_is_negated(char **valp);
int sudo_ldap_parse_option(char *optstr, char **varp, char **valp);