Module Name:    src
Committed By:   lukem
Date:           Sun Apr 12 23:59:37 UTC 2009

Modified Files:
        src/usr.bin/passwd: local_passwd.c passwd.c yp_passwd.c

Log Message:
Fix WARNS=4 issues


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/passwd/local_passwd.c
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/passwd/passwd.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/passwd/yp_passwd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/passwd/local_passwd.c
diff -u src/usr.bin/passwd/local_passwd.c:1.31 src/usr.bin/passwd/local_passwd.c:1.32
--- src/usr.bin/passwd/local_passwd.c:1.31	Fri Jan 25 19:36:27 2008
+++ src/usr.bin/passwd/local_passwd.c	Sun Apr 12 23:59:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: local_passwd.c,v 1.31 2008/01/25 19:36:27 christos Exp $	*/
+/*	$NetBSD: local_passwd.c,v 1.32 2009/04/12 23:59:37 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)local_passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: local_passwd.c,v 1.31 2008/01/25 19:36:27 christos Exp $");
+__RCSID("$NetBSD: local_passwd.c,v 1.32 2009/04/12 23:59:37 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -81,7 +81,7 @@
 			(void)printf("Password unchanged.\n");
 			pw_error(NULL, 0, 0);
 		}
-		if (min_pw_len > 0 && strlen(p) < min_pw_len) {
+		if (min_pw_len > 0 && (int)strlen(p) < min_pw_len) {
 			(void) printf("Password is too short.\n");
 			continue;
 		}

Index: src/usr.bin/passwd/passwd.c
diff -u src/usr.bin/passwd/passwd.c:1.28 src/usr.bin/passwd/passwd.c:1.29
--- src/usr.bin/passwd/passwd.c:1.28	Mon Jul 21 14:19:24 2008
+++ src/usr.bin/passwd/passwd.c	Sun Apr 12 23:59:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: passwd.c,v 1.28 2008/07/21 14:19:24 lukem Exp $	*/
+/*	$NetBSD: passwd.c,v 1.29 2009/04/12 23:59:37 lukem Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: passwd.c,v 1.28 2008/07/21 14:19:24 lukem Exp $");
+__RCSID("$NetBSD: passwd.c,v 1.29 2009/04/12 23:59:37 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,7 +79,7 @@
 	/* default -- use whatever PAM decides */
 	{ NULL, NULL, 0, NULL, pwpam_process },
 
-	{ 0 }
+	{ NULL, NULL, 0, NULL, NULL }
 };
 
 static const struct pw_module_s *personality;

Index: src/usr.bin/passwd/yp_passwd.c
diff -u src/usr.bin/passwd/yp_passwd.c:1.32 src/usr.bin/passwd/yp_passwd.c:1.33
--- src/usr.bin/passwd/yp_passwd.c:1.32	Fri Jan 25 19:36:12 2008
+++ src/usr.bin/passwd/yp_passwd.c	Sun Apr 12 23:59:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: yp_passwd.c,v 1.32 2008/01/25 19:36:12 christos Exp $	*/
+/*	$NetBSD: yp_passwd.c,v 1.33 2009/04/12 23:59:37 lukem Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from:  @(#)local_passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: yp_passwd.c,v 1.32 2008/01/25 19:36:12 christos Exp $");
+__RCSID("$NetBSD: yp_passwd.c,v 1.33 2009/04/12 23:59:37 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -71,10 +71,10 @@
 static char *domain;
 
 static void
-pwerror(char *name, int err, int eval)
+pwerror(const char *name, int show_err, int eval)
 {
 
-	if (err)
+	if (show_err)
 		warn("%s", name);
 	errx(eval, "NIS passwd database unchanged");
 }
@@ -83,7 +83,8 @@
 getnewpasswd(struct passwd *pw, char **old_pass)
 {
 	int tries;
-	char *p, *t;
+	const char *p, *t;
+	char *result;
 	static char buf[_PASSWORD_LEN+1];
 	char salt[_PASSWORD_LEN+1];
 	char option[LINE_MAX], *key, *opt;
@@ -140,12 +141,12 @@
 		warn("Couldn't generate salt");
 		pwerror(NULL, 0, 0);
 	}
-	p = strdup(crypt(buf, salt));
-	if (!p) {
+	result = strdup(crypt(buf, salt));
+	if (!result) {
 		(void)printf("not enough core.\n");
 		pwerror(NULL, 0, 0);
 	}
-	return (p);
+	return (result);
 }
 
 static void

Reply via email to