From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 12 02:40:26 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C1ED16A4D3 for ; Sun, 12 Sep 2004 02:40:26 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 804CB43D31 for ; Sun, 12 Sep 2004 02:40:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8C2eQsn087017 for ; Sun, 12 Sep 2004 02:40:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8C2eQpJ087016; Sun, 12 Sep 2004 02:40:26 GMT (envelope-from gnats) Resent-Date: Sun, 12 Sep 2004 02:40:26 GMT Resent-Message-Id: <200409120240.i8C2eQpJ087016@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Lukes Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E08B416A4CE for ; Sun, 12 Sep 2004 02:37:52 +0000 (GMT) Received: from kulesh.obluda.cz (kulesh.obluda.cz [193.179.22.243]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4448643D39 for ; Sun, 12 Sep 2004 02:37:51 +0000 (GMT) (envelope-from dan@obluda.cz) Received: from kulesh.obluda.cz (localhost.eunet.cz [127.0.0.1]) by kulesh.obluda.cz (8.13.1/8.13.1) with ESMTP id i8C2bnCw007103 for ; Sun, 12 Sep 2004 04:37:50 +0200 (CEST) (envelope-from dan@obluda.cz) Received: (from root@localhost) by kulesh.obluda.cz (8.13.1/8.13.1/Submit) id i8C2bnFG007102 for FreeBSD-gnats-submit@freebsd.org; Sun, 12 Sep 2004 04:37:49 +0200 (CEST) (envelope-from dan@obluda.cz) Message-Id: <200409120237.i8C2bnFG007102@kulesh.obluda.cz> Date: Sun, 12 Sep 2004 04:37:49 +0200 (CEST) From: Dan Lukes To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/71621: [PATCH] cleanup of the usr.sbin/sliplogin code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dan Lukes List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2004 02:40:26 -0000 >Number: 71621 >Category: bin >Synopsis: [PATCH] cleanup of the usr.sbin/sliplogin 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:26 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@kulesh.obluda.cz:/usr/obj/usr/src/sys/Dan i386 usr.sbin/sliplogin/sliplogin.c,v 1.15 2004/08/07 04:28:55 imp >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/sliplogin/sliplogin.c:31: warning: 'copyright' defined but not used usr.sbin/sliplogin/sliplogin.c:37: warning: 'sccsid' defined but not used usr.sbin/sliplogin/sliplogin.c:38: warning: 'rscid' defined but not used usr.sbin/sliplogin/sliplogin.c:138: warning: missing braces around initializer usr.sbin/sliplogin/sliplogin.c:319: warning: long int format, speed_t arg (arg 6) usr.sbin/sliplogin/sliplogin.c:508: warning: long int format, speed_t arg (arg 6) usr.sbin/sliplogin/sliplogin.c:530: warning: suggest parentheses around assignment used as truth value >How-To-Repeat: N/A >Fix: *** usr.sbin/sliplogin/sliplogin.c.ORIG Sun Aug 8 21:14:06 2004 --- usr.sbin/sliplogin/sliplogin.c Mon Sep 6 18:15:46 2004 *************** *** 27,43 **** * SUCH DAMAGE. */ - #ifndef lint - static char copyright[] = - "@(#) Copyright (c) 1990, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; - #endif /* not lint */ - - #ifndef lint - static char sccsid[] = "@(#)sliplogin.c 8.2 (Berkeley) 2/1/94"; - static char rscid[] = "@(#)$FreeBSD: src/usr.sbin/sliplogin/sliplogin.c,v 1.15 2004/08/07 04:28:55 imp Exp $"; - #endif /* not lint */ - /* * sliplogin.c * [MUST BE RUN SUID, SLOPEN DOES A SUSER()!] --- 27,32 ---- *************** *** 64,69 **** --- 53,68 ---- * /etc/slip.hosts file and if found fd0 is configured as in case 1. */ + #include + #ifndef lint + static const char copyright[] __unused = + "@(#) Copyright (c) 1990, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; + static const char sccsid[] __unused = "@(#)sliplogin.c 8.2 (Berkeley) 2/1/94"; + #endif /* not lint */ + + __FBSDID("$FreeBSD: src/usr.sbin/sliplogin/sliplogin.c,v 1.15 2004/08/07 04:28:55 imp Exp $"); + #include #include #include *************** *** 135,144 **** int sm_or_flag; int sm_and_flag; } modes[] = { ! "normal", 0 , 0 , ! "compress", IFF_LINK0, IFF_LINK2, ! "noicmp", IFF_LINK1, 0 , ! "autocomp", IFF_LINK2, IFF_LINK0, }; void --- 134,143 ---- int sm_or_flag; int sm_and_flag; } modes[] = { ! { "normal", 0 , 0 }, ! { "compress", IFF_LINK0, IFF_LINK2 }, ! { "noicmp", IFF_LINK1, 0 }, ! { "autocomp", IFF_LINK2, IFF_LINK0 }, }; void *************** *** 316,322 **** if (access(logoutfile, R_OK|X_OK) == 0) { char logincmd[2*MAXPATHLEN+32]; ! (void) snprintf(logincmd, sizeof(logincmd), "%s %d %ld %s", logoutfile, unit, speed, loginargs); (void) system(logincmd); } syslog(LOG_INFO, "closed %s slip unit %d (%s)\n", loginname, unit, --- 315,321 ---- if (access(logoutfile, R_OK|X_OK) == 0) { char logincmd[2*MAXPATHLEN+32]; ! (void) snprintf(logincmd, sizeof(logincmd), "%s %d %ld %s", logoutfile, unit, (long int)speed, loginargs); (void) system(logincmd); } syslog(LOG_INFO, "closed %s slip unit %d (%s)\n", loginname, unit, *************** *** 504,510 **** syslog(LOG_INFO, "attaching slip unit %d for %s\n", unit, loginname); ! (void)snprintf(logincmd, sizeof(logincmd), "%s %d %ld %s", loginfile, unit, speed, loginargs); /* * aim stdout and errout at /dev/null so logincmd output won't --- 503,509 ---- syslog(LOG_INFO, "attaching slip unit %d for %s\n", unit, loginname); ! (void)snprintf(logincmd, sizeof(logincmd), "%s %d %ld %s", loginfile, unit, (long int)speed, loginargs); /* * aim stdout and errout at /dev/null so logincmd output won't *************** *** 527,533 **** * to see whether changes are allowed (or just "route get"). */ (void) setuid(0); ! if (s = system(logincmd)) { syslog(LOG_ERR, "%s login failed: exit status %d from %s", loginname, s, loginfile); exit(6); --- 526,532 ---- * to see whether changes are allowed (or just "route get"). */ (void) setuid(0); ! if ((s = system(logincmd))) { syslog(LOG_ERR, "%s login failed: exit status %d from %s", loginname, s, loginfile); exit(6); >Release-Note: >Audit-Trail: >Unformatted: