CVS commit: src/usr.sbin/timed/timed

2020-02-09 Thread Santhosh Raju
Module Name:src
Committed By:   fox
Date:   Sun Feb  9 15:13:28 UTC 2020

Modified Files:
src/usr.sbin/timed/timed: Makefile

Log Message:
usr.sbin/timed: Suppress -Werror=stringop-truncation error.

Add GCC_NO_STRINGOP_TRUNCATION master.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/timed/timed/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/timed/timed/Makefile
diff -u src/usr.sbin/timed/timed/Makefile:1.13 src/usr.sbin/timed/timed/Makefile:1.14
--- src/usr.sbin/timed/timed/Makefile:1.13	Mon Nov 11 22:45:32 2019
+++ src/usr.sbin/timed/timed/Makefile	Sun Feb  9 15:13:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/11/11 22:45:32 joerg Exp $
+#	$NetBSD: Makefile,v 1.14 2020/02/09 15:13:28 fox Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 #
 # optional flags are: MEASURE TESTING DEBUG
@@ -13,4 +13,6 @@ MAN=	timed.8
 
 CWARNFLAGS.clang+=	-Wno-error=implicit-int-float-conversion
 
+COPTS.master.c+=	${GCC_NO_STRINGOP_TRUNCATION}
+
 .include 



CVS commit: src/usr.sbin/timed/timed

2018-01-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Jan 16 07:57:58 UTC 2018

Modified Files:
src/usr.sbin/timed/timed: slave.c timed-extern.h

Log Message:
Returns void, mark noreturn.

>From Eitan Adler in PR bin/52925


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/timed/timed/slave.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/timed/timed/timed-extern.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/timed/timed/slave.c
diff -u src/usr.sbin/timed/timed/slave.c:1.18 src/usr.sbin/timed/timed/slave.c:1.19
--- src/usr.sbin/timed/timed/slave.c:1.18	Fri Jan 26 16:12:41 2007
+++ src/usr.sbin/timed/timed/slave.c	Tue Jan 16 07:57:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: slave.c,v 1.18 2007/01/26 16:12:41 christos Exp $	*/
+/*	$NetBSD: slave.c,v 1.19 2018/01/16 07:57:58 maya Exp $	*/
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)slave.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: slave.c,v 1.18 2007/01/26 16:12:41 christos Exp $");
+__RCSID("$NetBSD: slave.c,v 1.19 2018/01/16 07:57:58 maya Exp $");
 #endif
 #endif /* not lint */
 
@@ -56,7 +56,7 @@ static void schgdate(struct tsp *, char 
 static void setmaster(struct tsp *);
 static void answerdelay(void);
 
-int
+void
 slave(void)
 {
 	int tries;

Index: src/usr.sbin/timed/timed/timed-extern.h
diff -u src/usr.sbin/timed/timed/timed-extern.h:1.10 src/usr.sbin/timed/timed/timed-extern.h:1.11
--- src/usr.sbin/timed/timed/timed-extern.h:1.10	Wed Aug 31 13:32:41 2011
+++ src/usr.sbin/timed/timed/timed-extern.h	Tue Jan 16 07:57:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: timed-extern.h,v 1.10 2011/08/31 13:32:41 joerg Exp $	*/
+/*	$NetBSD: timed-extern.h,v 1.11 2018/01/16 07:57:58 maya Exp $	*/
 
 /*-
  * Copyright (c) 1993 The Regents of the University of California.
@@ -74,7 +74,7 @@ void	 print(struct tsp *, struct sockadd
 void	 prthp(clock_t);
 void	 rmnetmachs(struct netinfo *);
 void	 setstatus(void);
-int	 slave(void);
+void	 slave(void) __dead;
 void	 slaveack(void);
 void	 spreadtime(void);
 void	 suppress(struct sockaddr_in *, char *, struct netinfo *);



CVS commit: src/usr.sbin/timed/timed

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Aug 11 16:47:42 UTC 2017

Modified Files:
src/usr.sbin/timed/timed: readmsg.c

Log Message:
PR bin/42464: Timothy McIntosh: Fix timed interoperability

Fix is a combination of FreeBSD fix and submitted patch.

[From the FreeBSD change]
The timed protocol is not implemented in a compatible way by all
vendors; the size of the tsp_name field is OS-dependent.  4.3BSD
used a 32-byte field, FreeBSD uses MAXHOSTNAMELEN and RedHat
apparently uses a 64-byte field.  As a result, sanity checking code
added a few months ago to detect short packets will fail when
interoperating with one of these other vendors.

Change the short packet detection code to expect a minimum packet
size corresponding to the 4.3BSD implementation, which should be
a safe minimum size.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/timed/timed/readmsg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/timed/timed/readmsg.c
diff -u src/usr.sbin/timed/timed/readmsg.c:1.22 src/usr.sbin/timed/timed/readmsg.c:1.23
--- src/usr.sbin/timed/timed/readmsg.c:1.22	Sat Feb 16 07:30:15 2008
+++ src/usr.sbin/timed/timed/readmsg.c	Fri Aug 11 16:47:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: readmsg.c,v 1.22 2008/02/16 07:30:15 matt Exp $	*/
+/*	$NetBSD: readmsg.c,v 1.23 2017/08/11 16:47:42 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)readmsg.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: readmsg.c,v 1.22 2008/02/16 07:30:15 matt Exp $");
+__RCSID("$NetBSD: readmsg.c,v 1.23 2017/08/11 16:47:42 ginsbach Exp $");
 #endif
 #endif /* not lint */
 
@@ -203,15 +203,22 @@ again:
 			continue;
 		}
 		length = sizeof(from);
+		memset(, 0, sizeof(msgin));
 		if ((n = recvfrom(sock, , sizeof(struct tsp), 0,
 			 (struct sockaddr*)(void *), )) < 0) {
 			syslog(LOG_ERR, "recvfrom: %m");
 			exit(EXIT_FAILURE);
 		}
-		if (n < (ssize_t)sizeof(struct tsp)) {
+		/*
+		 * The 4.3BSD protocol spec had a 32-byte tsp_name field, and
+		 * this is still OS-dependent.  Demand that the packet is at
+		 * least long enough to hold a 4.3BSD packet.
+		 */
+		if (n < (ssize_t)(sizeof(struct tsp) - MAXHOSTNAMELEN + 32)) {
 			syslog(LOG_NOTICE,
 			"short packet (%lu/%lu bytes) from %s",
-			  (u_long)n, (u_long)sizeof(struct tsp),
+			  (u_long)n,
+			  (u_long)(sizeof(struct tsp) - MAXHOSTNAMELEN + 32),
 			  inet_ntoa(from.sin_addr));
 			continue;
 		}



CVS commit: src/usr.sbin/timed/timed

2012-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  4 22:36:58 UTC 2012

Modified Files:
src/usr.sbin/timed/timed: measure.c

Log Message:
include utmpx.h if needed


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/timed/timed/measure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/timed/timed/measure.c
diff -u src/usr.sbin/timed/timed/measure.c:1.16 src/usr.sbin/timed/timed/measure.c:1.17
--- src/usr.sbin/timed/timed/measure.c:1.16	Sun Feb  4 16:17:01 2007
+++ src/usr.sbin/timed/timed/measure.c	Sun Nov  4 17:36:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: measure.c,v 1.16 2007/02/04 21:17:01 cbiere Exp $	*/
+/*	$NetBSD: measure.c,v 1.17 2012/11/04 22:36:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)measure.c	8.2 (Berkeley) 3/26/95;
 #else
-__RCSID($NetBSD: measure.c,v 1.16 2007/02/04 21:17:01 cbiere Exp $);
+__RCSID($NetBSD: measure.c,v 1.17 2012/11/04 22:36:58 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -43,6 +43,9 @@ __RCSID($NetBSD: measure.c,v 1.16 2007/
 #include netinet/ip.h
 #include netinet/ip_icmp.h
 #include util.h
+#ifdef SUPPORT_UTMPX
+#include utmpx.h
+#endif
 
 #define MSEC_DAY	(SECDAY*1000)