[Freeipa-devel] [PATCH] added response type PAM_ENV_ITEM and integrated response data

Simo Sorce ssorce at redhat.com
Thu Mar 19 14:11:23 UTC 2009


On Thu, 2009-03-19 at 14:55 +0100, Sumit Bose wrote:
> +                    ret = putenv((char *) &buf[p]);
> +                    if (ret == -1) {
> +                        D(("putenv failed.\n"));
> +                        break;
> +                    }

Nack here, putenv uses the string passed in, so you have to, at least
strdup() the string before using it, and not free it, or you will end up
corrupting the environment.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the Freeipa-devel mailing list