summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-02-08 20:19:10 +0000
committerdes <des@FreeBSD.org>2003-02-08 20:19:10 +0000
commitbf4fc37a1a7d9febcbb027f2eb88a787f7f5c4f2 (patch)
treecb8cfaf688e57b1a39743d243cb409a5bf889a22 /contrib
parente386e297defab77aae97e35daddceef111b99beb (diff)
parent5945314a7a72384610ca7385f7bf6aa3bda5288b (diff)
downloadFreeBSD-src-bf4fc37a1a7d9febcbb027f2eb88a787f7f5c4f2.zip
FreeBSD-src-bf4fc37a1a7d9febcbb027f2eb88a787f7f5c4f2.tar.gz
This commit was generated by cvs2svn to compensate for changes in r110558,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/openpam/lib/pam_getenv.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/openpam/lib/pam_getenv.c b/contrib/openpam/lib/pam_getenv.c
index a00c7cf..58ad283 100644
--- a/contrib/openpam/lib/pam_getenv.c
+++ b/contrib/openpam/lib/pam_getenv.c
@@ -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);
}
/**
OpenPOWER on IntegriCloud