History log of /openbsd-current/games/hunt/huntd/driver.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.30 14-Feb-2020 schwarze

no need to declare "extern optarg" and "extern optind"
when <unistd.h> is included;
patch from Jan Stary <hans at stare dot cz>;
OK millert


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.29 21-Jan-2017 krw

Nuke whitespace foolish enough to expose itself during the great
"warning:" rectification.


Revision tags: OPENBSD_6_0_BASE
# 1.28 28-Mar-2016 chl

remove unused variables

ok millert@


# 1.27 21-Mar-2016 guenther

Instead of creating a socket with socket() or accept() and then
setting the O_NONBLOCK flag on it with fcntl(F_SETFL) afterwards,
just pass SOCK_NONBLOCK to socket() or accept4() and get it right
to begin with.

ok millert@ krw@ beck@ deraadt@ jca@


Revision tags: OPENBSD_5_9_BASE
# 1.26 07-Jan-2016 mestre

ANSIfy hunt(6)

Note: casted 2 args to struct sockaddr * on list.c to shut off compiler
warnings, and also changed an int len to socklen_t since recvfrom(2) receives
the last argument as the latter.

I'm running out of credits, but this was once again with great help and OK from
tb@


# 1.25 07-Jan-2016 mestre

Headers cleanup and sorting

OK tb@


# 1.24 07-Jan-2016 tb

Some basic code maintenance in games/

- in main() replace exit with return
- drop some /* NOTREACHED */ lint comments along the way.
- make more use of standard CFLAGS, esp. -Wimplicit-function-declaration
- add and sort some headers when needed
- add straightforward pledges to some programs used at compile time

discussed with and ok mestre@


# 1.23 16-Dec-2015 tb

Use __progname instead of hand-rolled parsing of argv[0].
Inspired by similar diffs by tobias@ and millert@.

"I like the concept" pjanzen@
ok tedu@


# 1.22 25-Sep-2015 schwarze

Fix -D in the synopsis line:
* Whitespace is allowed between -D and the variable name.
* Each -D option only takes one single assignment.
* Drop excessive .Sm macro.


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.21 23-Mar-2014 tedu

stop using libwrap. ok deraadt


Revision tags: OPENBSD_5_5_BASE
# 1.20 29-Aug-2013 naddy

replace srandomdev()+random() with the arc4random*() family
tweaks and ok millert@, ok deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 10-Dec-2009 beck

fix potential bugs spotted by parfait
ok millert@ pjanzen@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.18 02-Oct-2008 millert

Remove useless setsid() and setpgrp() calls and add -b option to
run huntd in the background like a true daemon. OK deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.17 02-Apr-2007 jmc

tidy up synopis and usage(); sort options; from Igor Sobrado


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.16 16-Jan-2004 espie

ISO C police: log and expl are reserved for the C library.
expl -> expl_string
log -> logit


Revision tags: OPENBSD_3_4_BASE
# 1.15 11-Jun-2003 pjanzen

New license from the official hunt release at
ftp://ftp.cgl.ucsf.edu/pub/hunt.shar.Z -- it has been approved by all three
authors (Conrad Huang, Ken Arnold, and Greg Couch).


Revision tags: OPENBSD_3_3_BASE
# 1.14 11-Mar-2003 david

double words and spelling fixes
ok pjanzen@


# 1.13 06-Dec-2002 millert

Replace things like srandom(time(NULL)) with srandomdev(3). random(3)
good enough for games but we should at least use a decent seed.
pjanzen@ OK


Revision tags: OPENBSD_3_2_BASE
# 1.12 31-May-2002 pjanzen

No dm -> no need to revoke setegid.


Revision tags: OPENBSD_3_1_BASE
# 1.11 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.10 13-Feb-2001 pjanzen

Quiet alpha warnings, principally with correct includes


Revision tags: OPENBSD_2_8_BASE
# 1.9 03-Jul-2000 pjanzen

A little more select() reinitialization.


# 1.8 30-Jun-2000 pjanzen

re-initialize timeout before each invocation of select()


Revision tags: OPENBSD_2_7_BASE
# 1.7 12-Dec-1999 d

User netdb to get well known port.
Remove unused 3rd arg to main().
Revoke any setgid privs (unnecessary?)
Add -D for command-line configuration options.
Properly handle new, spawning connections.
Fix that evil repeated-quit problem in two places.
Fix a bug where a server would quit only if it were questioned for stats.
Allow port sharing.
Clean up havechar().
Don't allow write() to block.

reviewed by pjanzen@


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE
# 1.6 22-Mar-1999 pjanzen

More accurate man page; more informative logging; use random() instead of
old internal routine (seems to minimize instant death on re-entry).


# 1.5 14-Mar-1999 pjanzen

Access control works now; also, some minor tidying and man page fixes.


# 1.4 01-Feb-1999 d

avoid denial of service attacks on server port; extra conf vars; fix otto


# 1.3 29-Jan-1999 d

major changes: security, curses, config


# 1.2 21-Jan-1999 d

ident for OpenBSD
mandoc-ify manual pages
use -locurses


# 1.1 21-Jan-1999 d

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.29 21-Jan-2017 krw

Nuke whitespace foolish enough to expose itself during the great
"warning:" rectification.


Revision tags: OPENBSD_6_0_BASE
# 1.28 28-Mar-2016 chl

remove unused variables

ok millert@


# 1.27 21-Mar-2016 guenther

Instead of creating a socket with socket() or accept() and then
setting the O_NONBLOCK flag on it with fcntl(F_SETFL) afterwards,
just pass SOCK_NONBLOCK to socket() or accept4() and get it right
to begin with.

ok millert@ krw@ beck@ deraadt@ jca@


Revision tags: OPENBSD_5_9_BASE
# 1.26 07-Jan-2016 mestre

ANSIfy hunt(6)

Note: casted 2 args to struct sockaddr * on list.c to shut off compiler
warnings, and also changed an int len to socklen_t since recvfrom(2) receives
the last argument as the latter.

I'm running out of credits, but this was once again with great help and OK from
tb@


# 1.25 07-Jan-2016 mestre

Headers cleanup and sorting

OK tb@


# 1.24 07-Jan-2016 tb

Some basic code maintenance in games/

- in main() replace exit with return
- drop some /* NOTREACHED */ lint comments along the way.
- make more use of standard CFLAGS, esp. -Wimplicit-function-declaration
- add and sort some headers when needed
- add straightforward pledges to some programs used at compile time

discussed with and ok mestre@


# 1.23 16-Dec-2015 tb

Use __progname instead of hand-rolled parsing of argv[0].
Inspired by similar diffs by tobias@ and millert@.

"I like the concept" pjanzen@
ok tedu@


# 1.22 25-Sep-2015 schwarze

Fix -D in the synopsis line:
* Whitespace is allowed between -D and the variable name.
* Each -D option only takes one single assignment.
* Drop excessive .Sm macro.


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.21 23-Mar-2014 tedu

stop using libwrap. ok deraadt


Revision tags: OPENBSD_5_5_BASE
# 1.20 29-Aug-2013 naddy

replace srandomdev()+random() with the arc4random*() family
tweaks and ok millert@, ok deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 10-Dec-2009 beck

fix potential bugs spotted by parfait
ok millert@ pjanzen@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.18 02-Oct-2008 millert

Remove useless setsid() and setpgrp() calls and add -b option to
run huntd in the background like a true daemon. OK deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.17 02-Apr-2007 jmc

tidy up synopis and usage(); sort options; from Igor Sobrado


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.16 16-Jan-2004 espie

ISO C police: log and expl are reserved for the C library.
expl -> expl_string
log -> logit


Revision tags: OPENBSD_3_4_BASE
# 1.15 11-Jun-2003 pjanzen

New license from the official hunt release at
ftp://ftp.cgl.ucsf.edu/pub/hunt.shar.Z -- it has been approved by all three
authors (Conrad Huang, Ken Arnold, and Greg Couch).


Revision tags: OPENBSD_3_3_BASE
# 1.14 11-Mar-2003 david

double words and spelling fixes
ok pjanzen@


# 1.13 06-Dec-2002 millert

Replace things like srandom(time(NULL)) with srandomdev(3). random(3)
good enough for games but we should at least use a decent seed.
pjanzen@ OK


Revision tags: OPENBSD_3_2_BASE
# 1.12 31-May-2002 pjanzen

No dm -> no need to revoke setegid.


Revision tags: OPENBSD_3_1_BASE
# 1.11 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.10 13-Feb-2001 pjanzen

Quiet alpha warnings, principally with correct includes


Revision tags: OPENBSD_2_8_BASE
# 1.9 03-Jul-2000 pjanzen

A little more select() reinitialization.


# 1.8 30-Jun-2000 pjanzen

re-initialize timeout before each invocation of select()


Revision tags: OPENBSD_2_7_BASE
# 1.7 12-Dec-1999 d

User netdb to get well known port.
Remove unused 3rd arg to main().
Revoke any setgid privs (unnecessary?)
Add -D for command-line configuration options.
Properly handle new, spawning connections.
Fix that evil repeated-quit problem in two places.
Fix a bug where a server would quit only if it were questioned for stats.
Allow port sharing.
Clean up havechar().
Don't allow write() to block.

reviewed by pjanzen@


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE
# 1.6 22-Mar-1999 pjanzen

More accurate man page; more informative logging; use random() instead of
old internal routine (seems to minimize instant death on re-entry).


# 1.5 14-Mar-1999 pjanzen

Access control works now; also, some minor tidying and man page fixes.


# 1.4 01-Feb-1999 d

avoid denial of service attacks on server port; extra conf vars; fix otto


# 1.3 29-Jan-1999 d

major changes: security, curses, config


# 1.2 21-Jan-1999 d

ident for OpenBSD
mandoc-ify manual pages
use -locurses


# 1.1 21-Jan-1999 d

branches: 1.1.1;
Initial revision