Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Feb 2003 12:13:32 -0800 (PST)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 24840 for review
Message-ID:  <200302082013.h18KDWOk059019@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=24840

Change 24840 by des@des.at.des.thinksec.com on 2003/02/08 12:13:00

	Apparently, nobody ever uses pam_getenv(3), because nobody has ever
	complained that it didn't work.  Make it return a pointer to the
	actual value of the requested environment variable.

Affected files ...

.. //depot/projects/openpam/lib/pam_getenv.c#12 edit

Differences ...

==== //depot/projects/openpam/lib/pam_getenv.c#12 (text+ko) ====

@@ -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#11 $
+ * $P4: //depot/projects/openpam/lib/pam_getenv.c#12 $
  */
 
 #include <stdlib.h>
@@ -62,7 +62,12 @@
 		RETURNS(NULL);
 	if ((i = openpam_findenv(pamh, name, strlen(name))) == -1)
 		RETURNS(NULL);
-	str = strdup(pamh->env[i]);
+	for (str = pamh->env[i]; *str != '\0'; ++str) {
+		if (*str == '=') {
+			++str;
+			break;
+		}
+	}
 	RETURNS(str);
 }
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302082013.h18KDWOk059019>