Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jun 2003 02:15:35 -0700 (PDT)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 33312 for review
Message-ID:  <200306180915.h5I9FZ75082930@repoman.freebsd.org>

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

Change 33312 by des@des.at.des.thinksec.com on 2003/06/18 02:14:58

	Checking the return value from pam_get_item(3) isn't enough, we also
	have to check that the item isn't NULL.
	
	Submitted by:	marcus

Affected files ...

.. //depot/projects/openpam/lib/pam_get_user.c#18 edit

Differences ...

==== //depot/projects/openpam/lib/pam_get_user.c#18 (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_get_user.c#17 $
+ * $P4: //depot/projects/openpam/lib/pam_get_user.c#18 $
  */
 
 #include <sys/param.h>
@@ -43,7 +43,7 @@
 
 #include "openpam_impl.h"
 
-const char user_prompt[] = "Login:";
+static const char user_prompt[] = "Login:";
 
 /*
  * XSSO 4.2.1
@@ -64,7 +64,7 @@
 	if (pamh == NULL || user == NULL)
 		RETURNC(PAM_SYSTEM_ERR);
 	r = pam_get_item(pamh, PAM_USER, (const void **)user);
-	if (r == PAM_SUCCESS)
+	if (r == PAM_SUCCESS && *user != NULL)
 		RETURNC(PAM_SUCCESS);
 	if (prompt == NULL) {
 		r = pam_get_item(pamh, PAM_USER_PROMPT, (const void **)&prompt);



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