Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 763cec613cce963d002e60af4268f080 > files > 1

finger-0.17-17.mga5.src.rpm

This patch ensures that an exact match will always be checked for,
which is necessary for finger to work at all if info about your
users is stored in a database for which the nsswitch module doesn't
provide the (deprecated) getpwent() functions.

--- bsd-finger-0.10/finger/finger.c	Sun Apr 11 00:55:54 1999
+++ bsd-finger-0.10/finger/finger.c	Sun Apr 11 00:57:25 1999
@@ -191,13 +191,12 @@
 	 * traverse the list of possible login names and check the login name
 	 * and real name against the name specified by the user.
 	 */
-	if (mflag) {
-		for (i = 0; i < argc; i++)
-			if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
-				enter_person(pw);
-				used[i] = 1;
-			}
-	} else for (pw = getpwent(); pw; pw = getpwent())
+	for (i = 0; i < argc; i++)
+		if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
+			enter_person(pw);
+			used[i] = 1;
+		}
+	if (!mflag) for (pw = getpwent(); pw; pw = getpwent())
 		for (i = 0; i < argc; i++)
 			if (used[i] >= 0 &&
 			    (!strcasecmp(pw->pw_name, argv[i]) ||