diff options
author | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 12:48:14 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 12:48:14 -0800 |
commit | d5b06b67bbeeed7c05c0eb2e05d6a972ad050d1c (patch) | |
tree | ba5654cffacfd2002eefc5bc3764a7971afff1dc /Linux-PAM/libpam_misc/help_env.c | |
parent | 4c51da22e068907adb7857d50f5109a467c94d7c (diff) | |
parent | 7cbfa335c57d068d59508c844f3957165cccfb9b (diff) | |
download | pam-d5b06b67bbeeed7c05c0eb2e05d6a972ad050d1c.tar.gz pam-d5b06b67bbeeed7c05c0eb2e05d6a972ad050d1c.tar.bz2 pam-d5b06b67bbeeed7c05c0eb2e05d6a972ad050d1c.zip |
New upstream version 0.99.7.1
Diffstat (limited to 'Linux-PAM/libpam_misc/help_env.c')
-rw-r--r-- | Linux-PAM/libpam_misc/help_env.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/Linux-PAM/libpam_misc/help_env.c b/Linux-PAM/libpam_misc/help_env.c index e1390984..f57951af 100644 --- a/Linux-PAM/libpam_misc/help_env.c +++ b/Linux-PAM/libpam_misc/help_env.c @@ -1,33 +1,18 @@ /* - * $Id: help_env.c,v 1.2 2000/12/04 19:02:34 baggins Exp $ + * $Id: help_env.c,v 1.4 2005/09/20 08:31:27 kukuk Exp $ * * This file was written by Andrew G. Morgan <morgan@parc.power.net> * */ +#include "config.h" + #include <stdlib.h> #include <stdio.h> #include <string.h> #include <security/pam_misc.h> /* - * This is a useful function for dumping the Linux-PAM environment - * into some local memory, prior to it all getting lost when pam_end() - * is called. - * - * Initially it was assumed that libpam did not do this part correctly - * (based on a loose email definition). The X/Open XSSO spec makes it - * clear that this function is a duplicate of the one already in - * libpam and therefore unnecessary. IT WILL BE COMPLETELY REMOVED - * IN libpam_misc 1.0 */ - -char **pam_misc_copy_env(pam_handle_t *pamh); -char **pam_misc_copy_env(pam_handle_t *pamh) -{ - return pam_getenvlist(pamh); -} - -/* * This function should be used to carefully dispose of the copied * environment. * @@ -89,9 +74,7 @@ int pam_misc_setenv(pam_handle_t *pamh, const char *name return PAM_PERM_DENIED; /* not allowed to overwrite */ } } - tmp = malloc(2+strlen(name)+strlen(value)); - if (tmp != NULL) { - sprintf(tmp,"%s=%s",name,value); + if (asprintf(&tmp, "%s=%s", name, value) >= 0) { D(("pam_putt()ing: %s", tmp)); retval = pam_putenv(pamh, tmp); _pam_overwrite(tmp); /* purge */ |