Displaying 1 result from an estimated 1 matches for "env_orig".
2006 Sep 18
1
BSD Auth: set child environment variables requested by login script [PATCH]
...as requested by the login script. To catch the setenv requests, we save
+ * the current environment and let auth_close() do the changes on an empty
+ * environment. unsetenv requests are lost.
+ */
+int
+auth_close_do_env(Authctxt *authctxt, auth_session_t *as)
+{
+ extern char **environ;
+ char **env_orig;
+ int ret;
+
+ env_orig = bsdauth_env_copy();
+ environ[0] = NULL;
+
+ ret = auth_close(as);
+
+ /* environ now contains all setenv changes done by auth_close(). */
+ authctxt->auth_env_mod = environ;
+ environ = env_orig;
+
+ return ret;
+}
+
+/* modify the child environment according to login...