Hi,

On Sat, Nov 28, 2015 at 5:03 AM, Steffan Karger <stef...@karger.me> wrote:

> As reported in trac #387, an x509 DN can contain duplicate fields.
> Previously, we would overwrite any previous field value with a new one if
> we would process a second same-name field.  Now, instead, append _$N,
> starting at N=1 to the name for each consequent field to export all fields
> to the enviroment.
>

A useful change and clean code. A couple of places could benefit from const
qualifiers, though:

--- a/src/openvpn/misc.c
> +++ b/src/openvpn/misc.c
> @@ -607,6 +607,16 @@ env_set_add (struct env_set *es, const char *str)
>    env_set_add_nolock (es, str);
>  }
>
> +const char*
> +env_set_get (struct env_set *es, const char *name)
>

... (const struct env_set *es,....   )      <to be matched in misc.h>

+{
> +  struct env_item *item = es->list;
>

const struct env_item *item = ...

+  while (item && !envstring_equal(item->string, name)) {
> +      item = item->next;
> +  }
> +  return item ? item->string : NULL;
> +}
>

Thanks,

Selva

Reply via email to