This commit was generated by cvs2svn to compensate for changes in r110558,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Dag-Erling Smørgrav 2003-02-08 20:19:10 +00:00
commit d83d846790

View File

@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $P4: //depot/projects/openpam/lib/pam_getenv.c#10 $
* $P4: //depot/projects/openpam/lib/pam_getenv.c#12 $
*/
#include <stdlib.h>
@ -52,16 +52,23 @@ char *
pam_getenv(pam_handle_t *pamh,
const char *name)
{
char *str;
int i;
ENTER();
ENTERS(name);
if (pamh == NULL)
RETURNS(NULL);
if (name == NULL || strchr(name, '=') != NULL)
RETURNS(NULL);
if ((i = openpam_findenv(pamh, name, strlen(name))) == -1)
RETURNS(NULL);
RETURNS(strdup(pamh->env[i]));
for (str = pamh->env[i]; *str != '\0'; ++str) {
if (*str == '=') {
++str;
break;
}
}
RETURNS(str);
}
/**