Commit Graph

48 Commits

Author SHA1 Message Date
joerg
663328acb0 Remove non-sensical .ad macro. Don't use .Xo/.Xc. 2009-04-08 13:31:38 +00:00
lukem
9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
matt
de8753b3b0 cmdtab is supposed to be const. 2008-02-16 07:31:13 +00:00
cbiere
2ed96b7598 * timed and timedc:
* Sprinkle const.
   * Use EXIT_FAILURE instead of 1.
   * Use err(), errx().
   * Use calloc() instead of malloc()+memset().
 * timedc:
   * Non-terminated hostnames or unknown tsp_type could
     cause a crash due to out-of-bounds reads in msite().
   * Check the received packet size.
   * Merged duplicated code into functions.
   * Moved variables into the relevant scopes.
   * Use connect() so that only the receiver can reply,
     send()/recv() can be used and rejected packets
     are immediately noticed by recv() instead of causing
     timeouts.
   * Updated manpage.
2007-02-04 21:17:01 +00:00
cbiere
28ea2557d4 Let timedc use the dedicated account "_timedc" for dropping privileges
instead of abusing the account "nobody".
2007-01-28 13:51:29 +00:00
cbiere
0f2ebef2a8 * timedc is no longer setuid-root and is only usable by root due to the
use of a raw socket for ICMP; thus there is also no need to differ
   between privileged and unprivileged commands.
 * Switch to user "nobody" after allocating the raw socket.
 * Close all file descriptors above 2 (just in case).
2007-01-27 17:57:45 +00:00
cbiere
0a2098a6e9 bind() in priv_resources() is now unnecessary as pointed out by christos. 2007-01-27 00:37:56 +00:00
cbiere
2ca958bb2f * Fixed a 64-bit issue in daydiff().
* Check the packet size and sender address in daydiff().
 * priv_resources(): Use bind() instead of bindresvport() because an
   reserved port is not required. This also resolves the interoperability
   issue reported in PR bin/35479.
2007-01-27 00:15:50 +00:00
christos
b772b1e89b sprinkle const. 2007-01-25 23:47:13 +00:00
cbiere
07c9d403fe * Modified in_cksum() so it can handle unaligned data.
* Replaced most strlcpy() with set_tsp_name() and get_tsp_name() because
   strlcpy() could potentially run out-of-bounds and doesn't zero out
   unused buffer space.
 * Replaced bcopy/bzero() with memcpy/memset().
 * Fixed potential alignment/aliasing issues in measure().
 * Replace u_short/u_long with uint16_t/uint32_t/in_addr_t where appropriate.
 * Renamed sin to addr because sin is a reserved identifier.
 * Use bindresvport() instead of looping over bind(); rresvport() returns
   a SOCK_STREAM socket not SOCK_DGRAM.
2007-01-25 23:25:20 +00:00
christos
06fe4f2600 - use rresvport() instead of open-coding it.
- use warn/err.
2007-01-25 22:28:03 +00:00
christos
2331183c52 PR/35479: djv AT bedford DOT net: fix byte order issue and zero the sockaddr. 2007-01-25 15:29:40 +00:00
christos
8852dbf5f6 This has not worked since 2003. (Hello Itojun!) 2006-06-15 19:32:55 +00:00
mrg
0c37c63edc change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
2006-05-09 20:18:05 +00:00
perry
9cdb3caf29 remove obsolete register declarations. 2005-02-06 04:56:27 +00:00
dsl
3cca093e74 Add (unsigned char) cast to ctype functions 2004-10-30 15:51:20 +00:00
wiz
d77d1962dd s/transmitts/transmits/
From Gavin Atkinson (FreeBSD bug 62346) via jmc@openbsd
2004-02-09 15:43:05 +00:00
itojun
912235966a makeargv overrun. from openbsd 2003-10-13 06:14:04 +00:00
agc
326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
wiz
40bce18021 Simplify macro usage. 2003-06-30 11:55:11 +00:00
itojun
c428db5b2f use strlcpy 2003-05-17 20:55:44 +00:00
mycroft
8efb63f066 select() -> poll(), nanosleep() 2002-09-19 00:01:33 +00:00
wiz
557fe0a8de ANSIfy and de-__P() a bit more. 2002-07-06 22:01:40 +00:00
wiz
8fb60bde2d Remove unused files (cf. timed{,c}/timed{,c}-extern.h). 2002-07-06 21:59:26 +00:00
wiz
09141f935a Sort sections. 2002-02-02 02:02:44 +00:00
reinoud
ec98fbc0db Code cleanup; remove all `#ifdef sgi' from the code... this clobbered the
code considerably and was mainly providing SGI specific logging facilities
and some hacks to improve the relyablility on SGI systems by increasing
priorities etc...
2001-09-02 00:13:05 +00:00
wiz
6e20d67676 Add sections to xrefs. Whitespace fixes. 2001-04-05 11:53:46 +00:00
lukem
30724dba3e LOG_ODELAY is deprecated; it's the default 2001-01-11 03:05:42 +00:00
mycroft
f5d7100e26 Nuke `extern int errno;' in code we compile with -Wstrict-prototypes. We get
the correct definition from errno.h.
2000-01-21 17:08:33 +00:00
garbled
d1407362ba More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:43:46 +00:00
mrg
32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
perry
3fe138c146 RCS Id Police. 1998-01-09 08:03:16 +00:00
lukem
9f6ff4ad6f use string.h instead of strings.h 1997-10-18 07:05:31 +00:00
lukem
31bc9c50ba WARNSify 1997-10-17 13:59:34 +00:00
mrg
18b882a973 merge lite-2 1997-10-17 08:49:29 +00:00
gwr
10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
gwr
012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
mrg
b6bb351e9c be safe with buffers. 1997-04-13 13:45:02 +00:00
pk
6ea706d3c0 Remove a comma. Use `.Dq'. 1995-08-18 15:26:45 +00:00
cgd
d065420b32 specify man pages the new way. 1994-12-22 11:43:15 +00:00
mycroft
c722eb32d7 Eliminate a compiler warning. 1993-12-07 23:25:00 +00:00
cgd
4bb7cfabaf update timed to the latest version, as supplied and ported by
<Vernon Schryver> vjs@calcite.rhyolite.com.
1993-11-03 11:08:15 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft
c3e42d1c64 Add RCS indentifiers. 1993-08-01 07:22:47 +00:00
mycroft
3731815919 Add RCS identifiers. 1993-07-30 20:50:20 +00:00
mrg
c78c6a22ab 4.4BSD-Lite2 1993-06-06 20:58:02 +00:00
cgd
477497da10 adjusted to take into acct. changes to ../timed/Makefile, which
resolved the cksum.i386.c problem.
1993-03-23 03:50:32 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00