freed by the caller; add free_pam_environment() and use it.
- (bal) [configure.ac] Missing ;; from cray patch.
- (bal) [monitor_mm.c openbsd-compat/xmmap.h] Move xmmap() defines
into it's own header.
+ - (stevesk) [auth-pam.[ch] session.c] pam_getenvlist() must be
+ freed by the caller; add free_pam_environment() and use it.
20020721
- (stevesk) [auth-pam.c] merge cosmetic changes from solar's
#endif /* HAVE_PAM_GETENVLIST */
}
+void free_pam_environment(char **env)
+{
+ int i;
+
+ if (env != NULL) {
+ for (i = 0; env[i] != NULL; i++)
+ xfree(env[i]);
+ }
+}
+
/* Print any messages that have been generated during authentication */
/* or account checking to stderr */
void print_pam_messages(void)
void finish_pam(void);
int auth_pam_password(Authctxt *authctxt, const char *password);
char **fetch_pam_environment(void);
+void free_pam_environment(char **env);
int do_pam_authenticate(int flags);
int do_pam_account(char *username, char *remote_user);
void do_pam_session(char *username, const char *ttyname);
s->authctxt->krb5_ticket_file);
#endif
#ifdef USE_PAM
- /* Pull in any environment variables that may have been set by PAM. */
- copy_environment(fetch_pam_environment(), &env, &envsize);
+ /*
+ * Pull in any environment variables that may have
+ * been set by PAM.
+ */
+ {
+ char **p;
+
+ p = fetch_pam_environment();
+ copy_environment(p, &env, &envsize);
+ free_pam_environment(p);
+ }
#endif /* USE_PAM */
if (auth_sock_name != NULL)