Re: chpass WARNS/lint fixes

Mike Barcroft <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Organization The FreeBSD Project
Message-ID <[email protected]>
[email protected] <[email protected]> writes:
> Index: chpass.c
> ===================================================================
> RCS file: /home/ncvs/src/usr.bin/chpass/chpass.c,v
> retrieving revision 1.20
> diff -u -d -r1.20 chpass.c
> --- chpass.c	22 Mar 2002 01:19:26 -0000	1.20
> +++ chpass.c	23 Mar 2002 00:45:13 -0000
> @@ -39,10 +39,11 @@
>  
>  #ifndef lint
>  static const char sccsid[] = "From: @(#)chpass.c	8.4 (Berkeley) 4/2/94";
> -static const char rcsid[] =
> -  "$FreeBSD: src/usr.bin/chpass/chpass.c,v 1.20 2002/03/22 01:19:26 imp Exp $";
>  #endif /* not lint */

The vendor ID should be restored from Rev 1.1 and then wrapped in
#if 0 ... #endif.

> +++ edit.c	23 Mar 2002 00:45:42 -0000
[...]
> @@ -260,7 +261,7 @@
>  	    pw->pw_name, pw->pw_passwd, (unsigned long)pw->pw_uid, 
>  	    (unsigned long)pw->pw_gid, pw->pw_class, (long)pw->pw_change,
>  	    (long)pw->pw_expire, pw->pw_gecos, pw->pw_dir,
> -	    pw->pw_shell) >= sizeof(buf)) {
> +	    pw->pw_shell) >= (int)sizeof(buf)) {

I don't like the idea of casting this down, but it won't make a
difference in this case unless LINE_MAX becomes much larger.

> Index: pw_yp.c
> ===================================================================
> RCS file: /home/ncvs/src/usr.bin/chpass/pw_yp.c,v
> retrieving revision 1.19
> diff -u -d -r1.19 pw_yp.c
> --- pw_yp.c	6 Feb 2002 15:26:04 -0000	1.19
> +++ pw_yp.c	23 Mar 2002 00:46:33 -0000
> @@ -34,35 +34,37 @@
>   * Written by Bill Paul <[email protected]>
>   * Center for Telecommunications Research
>   * Columbia University, New York City
> - *
> - * $FreeBSD: src/usr.bin/chpass/pw_yp.c,v 1.19 2002/02/06 15:26:04 des Exp $
>   */
>  
> +#include <sys/cdefs.h>
> +__FBSDID("$FreeBSD$");
> +
>  #ifdef YP
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <netdb.h>
> -#include <time.h>
> -#include <sys/types.h>
> +#include <sys/param.h>
>  #include <sys/stat.h>
> -#include <pwd.h>
> -#include <errno.h>
> -#include <err.h>
> -#include <unistd.h>
> -#include <db.h>
> -#include <fcntl.h>
> -#include <utmp.h>
> -#include <sys/types.h>
>  #include <sys/stat.h>
> -#include <sys/param.h>
> -#include <limits.h>
> +#include <sys/types.h>

New line needed.

>  #include <rpc/rpc.h>
>  #include <rpcsvc/yp.h>
> -struct dom_binding {};
>  #include <rpcsvc/ypclnt.h>
>  #include <rpcsvc/yppasswd.h>

New line needed.

> +#include <db.h>
> +#include <err.h>
> +#include <errno.h>
> +#include <fcntl.h>
> +#include <limits.h>
> +#include <netdb.h>
>  #include <pw_util.h>
> +#include <pwd.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>  
> +#include <time.h>
> +#include <unistd.h>
> +#include <utmp.h>
> +
> +struct dom_binding {};
> +

This seems bogus; what is it used for?

>  #include "pw_yp.h"
>  #include "ypxfr_extern.h"
>  #include "yppasswd_private.h"

The rest looks okay.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.