bin/71630: [PATCH] cleanup of the usr.sbin/pppd code

Dan Lukes dan at obluda.cz
Sat Sep 11 19:40:31 PDT 2004


>Number:         71630
>Category:       bin
>Synopsis:       [PATCH] cleanup of the usr.sbin/pppd code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 02:40:30 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD kulesh.obluda.cz 5.3-BETA3 FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 dan at kulesh.obluda.cz:/usr/obj/usr/src/sys/Dan i386
usr.sbin/pppd/auth.c,v 1.28 2003/10/26 06:01:06 peter
usr.sbin/pppd/cbcp.c,v 1.4 1999/08/28 01:19:00 peter
usr.sbin/pppd/ccp.c,v 1.10 1999/08/28 01:19:00 peter
usr.sbin/pppd/chap.c,v 1.10 1999/08/28 01:19:01 peter
usr.sbin/pppd/chap_ms.c,v 1.8 2000/02/24 21:10:28 markm
usr.sbin/pppd/demand.c,v 1.5 1999/08/28 01:19:02 peter
usr.sbin/pppd/fsm.c,v 1.10 2002/12/30 21:18:14 schweikh
usr.sbin/pppd/ipcp.c,v 1.12 1999/08/28 01:19:03 peter
usr.sbin/pppd/lcp.c,v 1.11 2003/04/07 13:34:00 fjoe
usr.sbin/pppd/magic.c,v 1.8 1999/08/28 01:19:05 peter
usr.sbin/pppd/main.c,v 1.21 2003/05/12 18:51:31 peter
usr.sbin/pppd/options.c,v 1.24 2002/05/06 08:39:43 dwmalone
usr.sbin/pppd/sys-bsd.c,v 1.20 2004/04/09 16:59:05 maxim
usr.sbin/pppd/upap.c,v 1.8 1999/08/28 01:19:08 peter

>Description:
	There are more than 5000 warnings issued during "make buildworld".
Some of them are false positives, but some of them are sign of true errors.

	Nobody is upset by warnings due it's amount, so some errors remain
uncorrected.

	I want to cleanup the code-base from warnings, so warnings will
become "attention mark" again.

usr.sbin/pppd/main.c:172: warning: 'iffile' might be used uninitialized in this function
usr.sbin/pppd/main.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/magic.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/fsm.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/lcp.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/ipcp.c:1086: warning: implicit declaration of function `exit'
usr.sbin/pppd/ipcp.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/upap.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/chap.c:37: warning: 'rcsid' defined but not used
usr.sbin/pppd/ccp.c:29: warning: 'rcsid' defined but not used
usr.sbin/pppd/demand.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/auth.c:680: warning: implicit declaration of function `warn'
usr.sbin/pppd/auth.c:978: warning: implicit declaration of function `logout'
usr.sbin/pppd/auth.c:989: warning: implicit declaration of function time_to_time32'
usr.sbin/pppd/auth.c:1002: warning: implicit declaration of function `login'
usr.sbin/pppd/auth.c:36: warning: 'rcsid' defined but not used
usr.sbin/pppd/options.c:21: warning: 'rcsid' defined but not used
usr.sbin/pppd/sys-bsd.c:189: warning: implicit declaration of function `kldload'
usr.sbin/pppd/sys-bsd.c:492: warning: implicit declaration of function `openpty'
usr.sbin/pppd/sys-bsd.c:24: warning: 'rcsid' defined but not used
usr.sbin/pppd/cbcp.c:22: warning: 'rcsid' defined but not used
usr.sbin/pppd/chap_ms.c:35: warning: 'rcsid' defined but not used


>How-To-Repeat:
	N/A
>Fix:
*** usr.sbin/pppd/auth.c.ORIG	Fri Nov 14 03:54:56 2003
--- usr.sbin/pppd/auth.c	Sat Sep 11 11:14:12 2004
***************
*** 32,40 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/auth.c,v 1.28 2003/10/26 06:01:06 peter Exp $";
! #endif
  
  #include <stdio.h>
  #include <stddef.h>
--- 32,39 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/auth.c,v 1.28 2003/10/26 06:01:06 peter Exp $");
  
  #include <stdio.h>
  #include <stddef.h>
***************
*** 47,54 ****
--- 46,56 ----
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <sys/socket.h>
+ #include <libutil.h>
+ #include <err.h>
  #include <utmp.h>
  #include <fcntl.h>
+ #include <timeconv.h>
  #if defined(_PATH_LASTLOG) && defined(_linux_)
  #include <lastlog.h>
  #endif
*** usr.sbin/pppd/cbcp.c.ORIG	Sat Aug 28 03:19:00 1999
--- usr.sbin/pppd/cbcp.c	Sat Sep 11 10:42:02 2004
***************
*** 18,26 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/cbcp.c,v 1.4 1999/08/28 01:19:00 peter Exp $";
! #endif
  
  #include <stdio.h>
  #include <string.h>
--- 18,25 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/cbcp.c,v 1.4 1999/08/28 01:19:00 peter Exp $");
  
  #include <stdio.h>
  #include <string.h>
*** usr.sbin/pppd/ccp.c.ORIG	Sat Aug 28 03:19:00 1999
--- usr.sbin/pppd/ccp.c	Sat Sep 11 10:43:02 2004
***************
*** 25,33 ****
   * OR MODIFICATIONS.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/ccp.c,v 1.10 1999/08/28 01:19:00 peter Exp $";
! #endif
  
  #include <string.h>
  #include <syslog.h>
--- 25,32 ----
   * OR MODIFICATIONS.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/ccp.c,v 1.10 1999/08/28 01:19:00 peter Exp $");
  
  #include <string.h>
  #include <syslog.h>
*** usr.sbin/pppd/chap.c.ORIG	Sat Aug 28 03:19:01 1999
--- usr.sbin/pppd/chap.c	Sat Sep 11 10:42:36 2004
***************
*** 33,41 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/chap.c,v 1.10 1999/08/28 01:19:01 peter Exp $";
! #endif
  
  /*
   * TODO:
--- 33,40 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/chap.c,v 1.10 1999/08/28 01:19:01 peter Exp $");
  
  /*
   * TODO:
*** usr.sbin/pppd/chap_ms.c.ORIG	Thu Feb 24 22:10:28 2000
--- usr.sbin/pppd/chap_ms.c	Sat Sep 11 10:43:18 2004
***************
*** 31,39 ****
   *   You should also use DOMAIN\\USERNAME as described in README.MSCHAP80
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/chap_ms.c,v 1.8 2000/02/24 21:10:28 markm Exp $";
! #endif
  
  #ifdef CHAPMS
  
--- 31,38 ----
   *   You should also use DOMAIN\\USERNAME as described in README.MSCHAP80
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/chap_ms.c,v 1.8 2000/02/24 21:10:28 markm Exp $");
  
  #ifdef CHAPMS
  
*** usr.sbin/pppd/demand.c.ORIG	Sat Aug 28 03:19:02 1999
--- usr.sbin/pppd/demand.c	Sat Sep 11 10:42:07 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/demand.c,v 1.5 1999/08/28 01:19:02 peter Exp $";
! #endif
  
  #include <stdio.h>
  #include <stdlib.h>
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/demand.c,v 1.5 1999/08/28 01:19:02 peter Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
*** usr.sbin/pppd/fsm.c.ORIG	Thu Jan  2 00:06:54 2003
--- usr.sbin/pppd/fsm.c	Sat Sep 11 11:11:16 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/fsm.c,v 1.10 2002/12/30 21:18:14 schweikh Exp $";
! #endif
  
  /*
   * TODO:
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/fsm.c,v 1.10 2002/12/30 21:18:14 schweikh Exp $");
  
  /*
   * TODO:
*** usr.sbin/pppd/ipcp.c.ORIG	Sat Aug 28 03:19:03 1999
--- usr.sbin/pppd/ipcp.c	Sat Sep 11 10:45:36 2004
***************
*** 17,31 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/ipcp.c,v 1.12 1999/08/28 01:19:03 peter Exp $";
! #endif
  
  /*
   * TODO:
   */
  
  #include <stdio.h>
  #include <string.h>
  #include <syslog.h>
  #include <netdb.h>
--- 17,31 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/ipcp.c,v 1.12 1999/08/28 01:19:03 peter Exp $");
  
  /*
   * TODO:
   */
  
  #include <stdio.h>
+ #include <stdlib.h>
  #include <string.h>
  #include <syslog.h>
  #include <netdb.h>
*** usr.sbin/pppd/lcp.c.ORIG	Sun Apr 13 20:16:11 2003
--- usr.sbin/pppd/lcp.c	Sat Sep 11 10:42:51 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/lcp.c,v 1.11 2003/04/07 13:34:00 fjoe Exp $";
! #endif
  
  /*
   * TODO:
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/lcp.c,v 1.11 2003/04/07 13:34:00 fjoe Exp $");
  
  /*
   * TODO:
*** usr.sbin/pppd/magic.c.ORIG	Sat Aug 28 03:19:05 1999
--- usr.sbin/pppd/magic.c	Sat Sep 11 10:41:50 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/magic.c,v 1.8 1999/08/28 01:19:05 peter Exp $";
! #endif
  
  #include <stdio.h>
  #include <unistd.h>
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/magic.c,v 1.8 1999/08/28 01:19:05 peter Exp $");
  
  #include <stdio.h>
  #include <unistd.h>
*** usr.sbin/pppd/main.c.ORIG	Thu May 29 19:34:18 2003
--- usr.sbin/pppd/main.c	Sat Sep 11 10:55:27 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/main.c,v 1.21 2003/05/12 18:51:31 peter Exp $";
! #endif
  
  #include <stdio.h>
  #include <ctype.h>
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/main.c,v 1.21 2003/05/12 18:51:31 peter Exp $");
  
  #include <stdio.h>
  #include <ctype.h>
***************
*** 169,175 ****
  {
      int i, n, fdflags;
      struct sigaction sa;
!     FILE *iffile;
      char *p;
      struct passwd *pw;
      struct timeval timo;
--- 168,174 ----
  {
      int i, n, fdflags;
      struct sigaction sa;
!     FILE *iffile = iffile; /* to avoid "may be used unitialized" warning */
      char *p;
      struct passwd *pw;
      struct timeval timo;
*** usr.sbin/pppd/options.c.ORIG	Mon May  6 10:39:43 2002
--- usr.sbin/pppd/options.c	Sat Sep 11 10:42:34 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/options.c,v 1.24 2002/05/06 08:39:43 dwmalone Exp $";
! #endif
  
  #include <ctype.h>
  #include <stdio.h>
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/options.c,v 1.24 2002/05/06 08:39:43 dwmalone Exp $");
  
  #include <ctype.h>
  #include <stdio.h>
*** usr.sbin/pppd/sys-bsd.c.ORIG	Sat Apr 17 20:57:50 2004
--- usr.sbin/pppd/sys-bsd.c	Sat Sep 11 10:51:45 2004
***************
*** 20,28 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/sys-bsd.c,v 1.20 2004/04/09 16:59:05 maxim Exp $";
! #endif
  /*	$NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $	*/
  
  /*
--- 20,27 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/sys-bsd.c,v 1.20 2004/04/09 16:59:05 maxim Exp $");
  /*	$NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $	*/
  
  /*
***************
*** 44,50 ****
--- 43,51 ----
  #include <sys/time.h>
  #include <sys/stat.h>
  #include <sys/param.h>
+ #include <sys/linker.h>
  #include <sys/module.h>
+ #include <libutil.h>
  #ifdef NetBSD1_2
  #include <util.h>
  #endif
*** usr.sbin/pppd/upap.c.ORIG	Sat Aug 28 03:19:08 1999
--- usr.sbin/pppd/upap.c	Sat Sep 11 10:42:56 2004
***************
*** 17,25 ****
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #ifndef lint
! static char rcsid[] = "$FreeBSD: src/usr.sbin/pppd/upap.c,v 1.8 1999/08/28 01:19:08 peter Exp $";
! #endif
  
  /*
   * TODO:
--- 17,24 ----
   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
! #include <sys/cdefs.h>
! __FBSDID("$FreeBSD: src/usr.sbin/pppd/upap.c,v 1.8 1999/08/28 01:19:08 peter Exp $");
  
  /*
   * TODO:
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list