search for: bsdauth_env_free

Displaying 1 result from an estimated 1 matches for "bsdauth_env_free".

2006 Sep 18
1
BSD Auth: set child environment variables requested by login script [PATCH]
...0; environ[i] != NULL; i++) + ; + copy = xmalloc((i + 1) * sizeof(char *)); + + for (i = 0; environ[i] != NULL; i++) { + len = strlen(environ[i]); + x = xmalloc(len + 1); + strncpy(x, environ[i], len + 1); + copy[i] = x; + } + copy[i] = NULL; + + return copy; +} + +/* free the copy. */ +void +bsdauth_env_free(Authctxt *authctxt, char **env) +{ + u_int i; + + if (env != NULL && authctxt->auth_env_mod != NULL) { + for (i = 0; env[i] != NULL; i++) + xfree(env[i]); + xfree(env); + } +} + +/* + * Wrapper around auth_close(): auth_close() changes the current environment + * as requested by the...