Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2002 22:35:55 -0500
From:      Mike Barcroft <mike@freebsd.org>
To:        markm@freebsd.org
Cc:        audit@freebsd.org
Subject:   Re: chpass WARNS/lint fixes
Message-ID:  <20020322223555.I80338@espresso.q9media.com>
In-Reply-To: <200203230056.g2N0uV1D047229@grimreaper.grondar.org>; from markm@freebsd.org on Sat, Mar 23, 2002 at 12:56:31AM %2B0000
References:  <200203230056.g2N0uV1D047229@grimreaper.grondar.org>

next in thread | previous in thread | raw e-mail | index | archive | help
markm@freebsd.org <markm@freebsd.org> 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 <wpaul@ctr.columbia.edu>
>   * 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




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