search for: auth_env_mod

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

2006 Sep 18
1
BSD Auth: set child environment variables requested by login script [PATCH]
...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 login script. To catch the setenv requests, we save + * the current environment and let auth_close() do...