[Midnightbsd-cvs] src [11412] trunk/usr.sbin/bootparamd: sync with freebsd.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Jul 6 22:25:09 EDT 2018


Revision: 11412
          http://svnweb.midnightbsd.org/src/?rev=11412
Author:   laffer1
Date:     2018-07-06 22:25:09 -0400 (Fri, 06 Jul 2018)
Log Message:
-----------
sync with freebsd.

Modified Paths:
--------------
    trunk/usr.sbin/bootparamd/Makefile
    trunk/usr.sbin/bootparamd/Makefile.inc
    trunk/usr.sbin/bootparamd/bootparamd/Makefile
    trunk/usr.sbin/bootparamd/bootparamd/bootparamd.8
    trunk/usr.sbin/bootparamd/bootparamd/bootparamd.c
    trunk/usr.sbin/bootparamd/bootparamd/bootparams.5
    trunk/usr.sbin/bootparamd/bootparamd/main.c
    trunk/usr.sbin/bootparamd/callbootd/Makefile
    trunk/usr.sbin/bootparamd/callbootd/callbootd.c

Property Changed:
----------------
    trunk/usr.sbin/bootparamd/Makefile.inc
    trunk/usr.sbin/bootparamd/bootparamd/bootparamd.8
    trunk/usr.sbin/bootparamd/bootparamd/bootparams.5

Modified: trunk/usr.sbin/bootparamd/Makefile
===================================================================
--- trunk/usr.sbin/bootparamd/Makefile	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/Makefile	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/bootparamd/Makefile 176096 2008-02-07 19:00:00Z rink $
 
 SUBDIR=	bootparamd callbootd
 

Modified: trunk/usr.sbin/bootparamd/Makefile.inc
===================================================================
--- trunk/usr.sbin/bootparamd/Makefile.inc	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/Makefile.inc	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile.inc	5.1 (Berkeley) 5/11/90
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/bootparamd/Makefile.inc 201390 2010-01-02 11:07:44Z ed $
 
 BINDIR?=	/usr/sbin
 


Property changes on: trunk/usr.sbin/bootparamd/Makefile.inc
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/bootparamd/bootparamd/Makefile
===================================================================
--- trunk/usr.sbin/bootparamd/bootparamd/Makefile	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/bootparamd/Makefile	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	from: @(#)Makefile	5.8 (Berkeley) 7/28/90
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/bootparamd/bootparamd/Makefile 231118 2012-02-07 09:27:07Z dim $
 
 .include <bsd.own.mk>
 

Modified: trunk/usr.sbin/bootparamd/bootparamd/bootparamd.8
===================================================================
--- trunk/usr.sbin/bootparamd/bootparamd/bootparamd.8	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/bootparamd/bootparamd.8	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,5 +1,6 @@
+.\" $MidnightBSD$
 .\" @(#)bootparamd.8
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.sbin/bootparamd/bootparamd/bootparamd.8 250582 2013-05-12 22:22:12Z joel $
 .Dd December 14, 2000
 .Dt BOOTPARAMD 8
 .Os
@@ -48,7 +49,7 @@
 .El
 .Sh FILES
 .Bl -tag -width /etc/bootparams -compact
-.It /etc/bootparams
+.It Pa /etc/bootparams
 default boot parameter file
 .El
 .Sh EXAMPLES
@@ -58,7 +59,7 @@
 To accommodate this behaviour add an alias address
 that responds to an all-0 broadcast.
 So, add something like
-.Ql "ifconfig xl0 192.168.200.254 netmask 255.255.255.255 broadcast 192.168.200.0 alias
+.Ql "ifconfig xl0 192.168.200.254 netmask 255.255.255.255 broadcast 192.168.200.0 alias"
 on the relevant network interface on your
 .Nm
 server.


Property changes on: trunk/usr.sbin/bootparamd/bootparamd/bootparamd.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/bootparamd/bootparamd/bootparamd.c
===================================================================
--- trunk/usr.sbin/bootparamd/bootparamd/bootparamd.c	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/bootparamd/bootparamd.c	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
 
 This code is not copyright, and is placed in the public domain. Feel free to
@@ -9,7 +10,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$MidnightBSD$";
+  "$FreeBSD: stable/10/usr.sbin/bootparamd/bootparamd/bootparamd.c 320780 2017-07-07 15:09:08Z asomers $";
 #endif /* not lint */
 
 #ifdef YP
@@ -114,7 +115,7 @@
 bp_getfile_arg *getfile;
 struct svc_req *req;
 {
-  char *where, *index();
+  char *where;
   static bp_getfile_res res;
 
   if (debug)
@@ -133,7 +134,7 @@
   askname[sizeof(askname)-1] = 0;
 
   if (getthefile(askname, getfile->file_id,buffer,sizeof(buffer))) {
-    if ( (where = index(buffer,':')) ) {
+    if ( (where = strchr(buffer,':')) ) {
       /* buffer is re-written to contain the name of the info of file */
       strncpy(hostname, buffer, where - buffer);
       hostname[where - buffer] = '\0';
@@ -199,7 +200,10 @@
 
   int ch, pch, fid_len, res = 0;
   int match = 0;
-  char info[MAX_FILEID + MAX_PATH_LEN+MAX_MACHINE_NAME + 3];
+#define INFOLEN 1343
+  _Static_assert(INFOLEN >= MAX_FILEID + MAX_PATH_LEN+MAX_MACHINE_NAME + 3,
+		  "INFOLEN isn't large enough");
+  char info[INFOLEN + 1];
 
   bpf = fopen(bootpfile, "r");
   if ( ! bpf )
@@ -252,7 +256,9 @@
 
   if (match) {
     fid_len = strlen(fileid);
-    while ( ! res && (fscanf(bpf,"%s", info)) > 0) { /* read a string */
+#define AS_FORMAT(d)	"%" #d "s"
+#define REXPAND(d) AS_FORMAT(d)	/* Force another preprocessor expansion */
+    while ( ! res && (fscanf(bpf, REXPAND(INFOLEN), info)) > 0) {
       ch = getc(bpf);                                /* and a character */
       if ( *info != '#' ) {                          /* Comment ? */
 	if (! strncmp(info, fileid, fid_len) && *(info + fid_len) == '=') {

Modified: trunk/usr.sbin/bootparamd/bootparamd/bootparams.5
===================================================================
--- trunk/usr.sbin/bootparamd/bootparamd/bootparams.5	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/bootparamd/bootparams.5	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\"
 .\" Copyright (c) 1994 Gordon W. Ross
 .\" All rights reserved.
@@ -25,7 +26,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"	from: Id: bootparams.5,v 1.2 1994/10/03 19:26:13 gwr Exp
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.sbin/bootparamd/bootparamd/bootparams.5 71573 2001-01-24 12:22:39Z ru $
 .\"
 .Dd October 2, 1994
 .Dt BOOTPARAMS 5


Property changes on: trunk/usr.sbin/bootparamd/bootparamd/bootparams.5
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/bootparamd/bootparamd/main.c
===================================================================
--- trunk/usr.sbin/bootparamd/bootparamd/main.c	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/bootparamd/main.c	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
 
 This code is not copyright, and is placed in the public domain. Feel free to
@@ -9,7 +10,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$MidnightBSD$";
+  "$FreeBSD: stable/10/usr.sbin/bootparamd/bootparamd/main.c 291042 2015-11-19 00:14:23Z ngie $";
 #endif /* not lint */
 
 #include <ctype.h>
@@ -36,13 +37,10 @@
 struct sockaddr_in my_addr;
 char *bootpfile = "/etc/bootparams";
 
-extern  void bootparamprog_1();
 static void usage(void);
 
 int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
 {
 	SVCXPRT *transp;
 	struct hostent *he;
@@ -110,7 +108,7 @@
 }
 
 static void
-usage()
+usage(void)
 {
 	fprintf(stderr,
 		"usage: bootparamd [-d] [-s] [-r router] [-f bootparmsfile]\n");

Modified: trunk/usr.sbin/bootparamd/callbootd/Makefile
===================================================================
--- trunk/usr.sbin/bootparamd/callbootd/Makefile	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/callbootd/Makefile	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,8 +1,9 @@
+# $MidnightBSD$
 #	from: @(#)Makefile	5.8 (Berkeley) 7/28/90
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/bootparamd/callbootd/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 PROG=	callbootd
-NO_MAN=
+MAN=
 SRCS=	callbootd.c ${GENSRCS}
 GENSRCS=bootparam_prot.h bootparam_prot_clnt.c bootparam_prot_xdr.c
 

Modified: trunk/usr.sbin/bootparamd/callbootd/callbootd.c
===================================================================
--- trunk/usr.sbin/bootparamd/callbootd/callbootd.c	2018-07-07 01:11:59 UTC (rev 11411)
+++ trunk/usr.sbin/bootparamd/callbootd/callbootd.c	2018-07-07 02:25:09 UTC (rev 11412)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
 
 This code is not copyright, and is placed in the public domain. Feel free to
@@ -9,7 +10,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$MidnightBSD$";
+  "$FreeBSD: stable/10/usr.sbin/bootparamd/callbootd/callbootd.c 324142 2017-09-30 20:50:31Z ngie $";
 #endif /* not lint */
 
 #include "bootparam_prot.h"
@@ -32,15 +33,12 @@
 char cln[MAX_MACHINE_NAME+1];
 char dmn[MAX_MACHINE_NAME+1];
 char path[MAX_PATH_LEN+1];
-extern char *inet_ntoa();
 static void usage(void);
 int printgetfile(bp_getfile_res *);
 int printwhoami(bp_whoami_res *);
 
-bool_t
-eachres_whoami(resultp, raddr)
-bp_whoami_res *resultp;
-struct sockaddr_in *raddr;
+static bool_t
+eachres_whoami(bp_whoami_res *resultp, struct sockaddr_in *raddr)
 {
   struct hostent *he;
 
@@ -51,10 +49,8 @@
   return(0);
 }
 
-bool_t
-eachres_getfile(resultp, raddr)
-bp_getfile_res *resultp;
-struct sockaddr_in *raddr;
+static bool_t
+eachres_getfile(bp_getfile_res *resultp, struct sockaddr_in *raddr)
 {
   struct hostent *he;
 
@@ -67,9 +63,7 @@
 
 
 int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
 {
   char *server;
 
@@ -81,7 +75,6 @@
 
   long the_inet_addr;
   CLIENT *clnt;
-  enum clnt_stat clnt_stat;
 
   stat_whoami_res.client_name = cln;
   stat_whoami_res.domain_name = dmn;
@@ -117,7 +110,7 @@
       } else
 	exit(0);
      } else {
-       clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
+       (void)clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
 			       BOOTPARAMPROC_WHOAMI,
 			       (xdrproc_t)xdr_bp_whoami_arg,
 			       (char *)&whoami_arg,
@@ -140,7 +133,7 @@
       } else
 	exit(0);
     } else {
-      clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
+      (void)clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
 			       BOOTPARAMPROC_GETFILE,
 			       (xdrproc_t)xdr_bp_getfile_arg,
 			       (char *)&getfile_arg,



More information about the Midnightbsd-cvs mailing list