chiark / gitweb /
adns.git
4 months agochangelog: Document changes in 1.6.0 and finalise version number master adns-1.6.0
Ian Jackson [Thu, 11 Jun 2020 14:47:17 +0000 (15:47 +0100)]
changelog: Document changes in 1.6.0 and finalise version number

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoRerun autoheader and autoconf 2.69
Ian Jackson [Thu, 11 Jun 2020 15:10:56 +0000 (16:10 +0100)]
Rerun autoheader and autoconf 2.69

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoProvide autogen.sh
Ian Jackson [Thu, 11 Jun 2020 15:10:43 +0000 (16:10 +0100)]
Provide autogen.sh

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoDocuemntation: No longer update NEWS
Ian Jackson [Thu, 11 Jun 2020 15:08:55 +0000 (16:08 +0100)]
Docuemntation: No longer update NEWS

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSupport DESTDIR=/some/absolute/path on `make install'
Ian Jackson [Mon, 8 Jun 2020 16:12:41 +0000 (17:12 +0100)]
Support DESTDIR=/some/absolute/path on `make install'

You must have done `make' *without* DESTDIR, first.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoadns_str* etc.: Permit calling on adns_s_* values (not _max_)
Ian Jackson [Mon, 25 May 2020 12:01:17 +0000 (13:01 +0100)]
adns_str* etc.: Permit calling on adns_s_* values (not _max_)

This is useful because otherwise an application may not use these
values for its own errors, if that might result in them being passed
to the adns_strerror etc.

No code change: the table already has all the values.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoadns_str* etc.: Return NULL rather than crashing, and docs
Ian Jackson [Mon, 25 May 2020 11:55:33 +0000 (12:55 +0100)]
adns_str* etc.: Return NULL rather than crashing, and docs

Previously, calling these functions with arbitrary values would cause
them to do a struct member lookup on a null pointer.  Now they return
the pointer instead.

Also, some users have been confused by the docs, and have passsed, for
example, adns_s_max_misconfig.  This is also not permitted.  Clarify
that only values actually returned by adns are allowed.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Test adns_if_monotonic
Ian Jackson [Sun, 24 May 2020 17:17:03 +0000 (18:17 +0100)]
regress: Test adns_if_monotonic

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: redirect clock_gettime
Ian Jackson [Sun, 24 May 2020 17:15:21 +0000 (18:15 +0100)]
regress: redirect clock_gettime

This will let us test it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotime handling: Support use of CLOCK_MONOTONIC
Ian Jackson [Sun, 24 May 2020 15:51:09 +0000 (16:51 +0100)]
time handling: Support use of CLOCK_MONOTONIC

This involves a new initflag.  And introducing a wrapper for
gettimeofday().

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
squash! time handling: Support use of CLOCK_MONOTONIC

squash! time handling: Support use of CLOCK_MONOTONIC

4 months agoregress: Test --reverse in adnshost -f input stream
Ian Jackson [Sat, 10 Dec 2016 01:22:11 +0000 (01:22 +0000)]
regress: Test --reverse in adnshost -f input stream

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: make gettimeofday not give invalid tv_usec values
Ian Jackson [Fri, 9 Dec 2016 22:02:20 +0000 (22:02 +0000)]
regress: fuzzraw: make gettimeofday not give invalid tv_usec values

I don't think adns should have to cope with tv_usec out of the range
0..999999.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Provide a dictionary suitable for AFL
Ian Jackson [Fri, 9 Dec 2016 21:12:18 +0000 (21:12 +0000)]
regress: fuzzraw: Provide a dictionary suitable for AFL

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Provide a dictionary
Ian Jackson [Fri, 9 Dec 2016 20:39:17 +0000 (20:39 +0000)]
regress: fuzzraw: Provide a dictionary

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoadnsresfilter: Honour --checkc-freq and --checkc-entex
Ian Jackson [Fri, 9 Dec 2016 20:38:30 +0000 (20:38 +0000)]
adnsresfilter: Honour --checkc-freq and --checkc-entex

This is mostly for debugging and fuzzing.  We don't document it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoadnslogres: Honour --checkc-freq (if it comes first)
Ian Jackson [Fri, 9 Dec 2016 20:36:37 +0000 (20:36 +0000)]
adnslogres: Honour --checkc-freq (if it comes first)

This is mostly for debugging and fuzzing.  We don't document it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoadnshost: Offer ability to set adns checkc flags
Ian Jackson [Fri, 9 Dec 2016 20:06:46 +0000 (20:06 +0000)]
adnshost: Offer ability to set adns checkc flags

This is mostly for debugging, fuzzing, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoadnshost: adh-opts.c: Whitespace adjustments to option table
Ian Jackson [Fri, 9 Dec 2016 19:58:12 +0000 (19:58 +0000)]
adnshost: adh-opts.c: Whitespace adjustments to option table

Wrap at 80.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzz: Reject argc==0
Ian Jackson [Tue, 6 Dec 2016 00:07:34 +0000 (00:07 +0000)]
regress: fuzz: Reject argc==0

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Introduce hm_rv_wlen
Ian Jackson [Thu, 1 Dec 2016 02:24:27 +0000 (02:24 +0000)]
regress: fuzzraw: Introduce hm_rv_wlen

This lets us stop AFL causing us to tell adns that write returned
stupidly large answers.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Improve make clean, and make check1fuzz a bit tidier
Ian Jackson [Thu, 1 Dec 2016 00:38:12 +0000 (00:38 +0000)]
regress: Improve make clean, and make check1fuzz a bit tidier

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Rename categorisefuzz
Ian Jackson [Thu, 1 Dec 2016 00:35:52 +0000 (00:35 +0000)]
regress: Rename categorisefuzz

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: categorise it too
Ian Jackson [Thu, 1 Dec 2016 00:34:17 +0000 (00:34 +0000)]
regress: fuzzraw: categorise it too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzz: Makefile: Depend directly on fuzz-%
Ian Jackson [Thu, 1 Dec 2016 00:31:35 +0000 (00:31 +0000)]
regress: fuzz: Makefile: Depend directly on fuzz-%

Our make1fuzz script generates fuzzraw-% and fuzz-% in one go.
Make the dependency direct so that make pattern rules work better.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzz: Fix check1fuzz and Makefile
Ian Jackson [Thu, 1 Dec 2016 00:28:32 +0000 (00:28 +0000)]
regress: fuzz: Fix check1fuzz and Makefile

Now checkfuzz seems to DTRT.  We compare the stdout, to check that our
program ran to completion.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: dup stderr too
Ian Jackson [Thu, 1 Dec 2016 00:27:26 +0000 (00:27 +0000)]
regress: fuzzraw: dup stderr too

fdopen does not dup.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzz: Send rc=? msg to stdout
Ian Jackson [Thu, 1 Dec 2016 00:26:30 +0000 (00:26 +0000)]
regress: fuzz: Send rc=? msg to stdout

We need a copy, because the test program may close it

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Tshutdown: Tolerate lack of Tensuresetup
Ian Jackson [Wed, 30 Nov 2016 23:50:43 +0000 (23:50 +0000)]
regress: fuzzraw: Tshutdown: Tolerate lack of Tensuresetup

If no syscalls were made, Tensuresetup won't have been called.

(We don't want to call it because it's what handles the first
gettimeofday timestamp, so we need to call it exactly when
hplayback.c.m4 calls it.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Move case-*.in opening to shlib playback_prepare
Ian Jackson [Wed, 30 Nov 2016 23:34:38 +0000 (23:34 +0000)]
regress: Move case-*.in opening to shlib playback_prepare

make1test needs it too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: implement poll
Ian Jackson [Wed, 30 Nov 2016 23:29:03 +0000 (23:29 +0000)]
regress: fuzzraw: implement poll

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Improve sync lost msg
Ian Jackson [Wed, 30 Nov 2016 23:27:02 +0000 (23:27 +0000)]
regress: fuzzraw: Improve sync lost msg

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Direct traceprint to stderr
Ian Jackson [Wed, 30 Nov 2016 23:21:07 +0000 (23:21 +0000)]
regress: fuzzraw: Direct traceprint to stderr

We open our own FILE* because the test program might fclose actual
stderr before returning from main.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Check traceprint in Q_vb
Ian Jackson [Wed, 30 Nov 2016 23:21:02 +0000 (23:21 +0000)]
regress: fuzzraw: Check traceprint in Q_vb

This may be called from Hexit, as well as our own Hfoos

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Add Tensuresetup into Hexit; remove it from Q_vb in hfuzzraw
Ian Jackson [Wed, 30 Nov 2016 23:17:02 +0000 (23:17 +0000)]
regress: Add Tensuresetup into Hexit; remove it from Q_vb in hfuzzraw

Everyone else's generated H* functions call Tensuresetup before they
call Q_vb.  So Hexit should too.

Q_vb in hfuzzraw no longer needs it then.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback: check poll sanity
Ian Jackson [Wed, 30 Nov 2016 23:13:36 +0000 (23:13 +0000)]
regress: playback: check poll sanity

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzz: change check1fuzz to send stderr to /dev/null
Ian Jackson [Wed, 30 Nov 2016 18:37:43 +0000 (18:37 +0000)]
regress: fuzz: change check1fuzz to send stderr to /dev/null

And also be less verbose when the test fails.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Rename traceprint functionality
Ian Jackson [Wed, 30 Nov 2016 18:28:38 +0000 (18:28 +0000)]
regress: fuzzraw: Rename traceprint functionality

Replace uses of stdout with uses of traceout, currently a #define.
Change some function names.

Only functional change is the change to the env var name.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback: Fold other Tensure calls into Tensuresetup
Ian Jackson [Wed, 30 Nov 2016 18:36:33 +0000 (18:36 +0000)]
regress: playback: Fold other Tensure calls into Tensuresetup

Rename Tensurereportfile and Tensurefuzzrawfile to be sure we didn't
miss any diredct call sites.

No significant functional change; we just do all of the idempotent
setup at each point.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Call Tensuresetup in Q_vb, just in case
Ian Jackson [Wed, 30 Nov 2016 18:34:37 +0000 (18:34 +0000)]
regress: fuzzraw: Call Tensuresetup in Q_vb, just in case

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Rename Tensurerecordfile to Tensuresetup
Ian Jackson [Wed, 30 Nov 2016 18:33:48 +0000 (18:33 +0000)]
regress: Rename Tensurerecordfile to Tensuresetup

This is much less confusing and reflects its real role better.  We
will deal with the remaining bits of Tensure<something> that aren't
Tensurerecordfile, in a moment.

 perl -i~ -pe 's/Tensurerecordfile/Tensuresetup/g' *.m4

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Move up Tensurerecordfile
Ian Jackson [Wed, 30 Nov 2016 18:25:32 +0000 (18:25 +0000)]
regress: fuzzraw: Move up Tensurerecordfile

Pure code motion

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: makefile and shell script fixes
Ian Jackson [Sun, 27 Nov 2016 22:24:34 +0000 (22:24 +0000)]
regress: fuzzraw: makefile and shell script fixes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Allow any positive errno value
Ian Jackson [Sun, 27 Nov 2016 22:04:16 +0000 (22:04 +0000)]
regress: fuzzraw: Allow any positive errno value

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Use syscall_sync in Hclose
Ian Jackson [Sun, 27 Nov 2016 22:04:03 +0000 (22:04 +0000)]
regress: fuzzraw: Use syscall_sync in Hclose

This has to mirror the non-special close in hm_stdsyscall_close

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Break out syscall_sync
Ian Jackson [Sun, 27 Nov 2016 22:03:30 +0000 (22:03 +0000)]
regress: fuzzraw: Break out syscall_sync

No functional change

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: fixes and improvements to Paddr and Pbytes
Ian Jackson [Sun, 27 Nov 2016 21:55:28 +0000 (21:55 +0000)]
regress: fuzzraw: fixes and improvements to Paddr and Pbytes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: work on fixing Paddr
Ian Jackson [Sun, 27 Nov 2016 21:46:24 +0000 (21:46 +0000)]
regress: fuzzraw: work on fixing Paddr

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Fix select Pfdset
Ian Jackson [Sun, 27 Nov 2016 21:32:01 +0000 (21:32 +0000)]
regress: fuzzraw: Fix select Pfdset

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Improve sync strings
Ian Jackson [Sun, 27 Nov 2016 20:32:09 +0000 (20:32 +0000)]
regress: fuzzraw: Improve sync strings

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Improve debug stdout from fuzzraw
Ian Jackson [Sun, 27 Nov 2016 20:31:56 +0000 (20:31 +0000)]
regress: Improve debug stdout from fuzzraw

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Introduce FUZZRAW_SYNC
Ian Jackson [Sun, 27 Nov 2016 19:48:04 +0000 (19:48 +0000)]
regress: Introduce FUZZRAW_SYNC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Constify FR_write
Ian Jackson [Sun, 27 Nov 2016 19:48:26 +0000 (19:48 +0000)]
regress: Constify FR_write

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Fix fcntl
Ian Jackson [Sun, 27 Nov 2016 19:32:58 +0000 (19:32 +0000)]
regress: fuzzraw: Fix fcntl

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Fix gettimeofday
Ian Jackson [Sun, 27 Nov 2016 19:32:52 +0000 (19:32 +0000)]
regress: fuzzraw: Fix gettimeofday

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Fix P_succfail
Ian Jackson [Sun, 27 Nov 2016 19:32:39 +0000 (19:32 +0000)]
regress: fuzzraw: Fix P_succfail

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Fixes to fdsets
Ian Jackson [Sun, 27 Nov 2016 19:32:29 +0000 (19:32 +0000)]
regress: fuzzraw: Fixes to fdsets

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw: Introduce P_read_dump
Ian Jackson [Sun, 27 Nov 2016 17:55:37 +0000 (17:55 +0000)]
regress: hfuzzraw: Introduce P_read_dump

This really helps debugging.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw: Break out Tflushstdout
Ian Jackson [Sun, 27 Nov 2016 17:55:25 +0000 (17:55 +0000)]
regress: hfuzzraw: Break out Tflushstdout

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Handle select and poll return value specially
Ian Jackson [Sun, 27 Nov 2016 17:54:02 +0000 (17:54 +0000)]
regress: fuzzraw: Handle select and poll return value specially

Don't read or write it to the fuzzraw stream.  Instead, in hfuzzraw,
calculate it from the returned fd set (and check it's consistent with
the timeout).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: *.m4: Add an hm_create_nothing to hrecord.c.m4
Ian Jackson [Sun, 27 Nov 2016 17:24:34 +0000 (17:24 +0000)]
regress: *.m4: Add an hm_create_nothing to hrecord.c.m4

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: *.m4: Provide for hm_rv_select and hm_rv_poll
Ian Jackson [Sun, 27 Nov 2016 17:21:20 +0000 (17:21 +0000)]
regress: *.m4: Provide for hm_rv_select and hm_rv_poll

They default to _any so there is no functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hmacros.i4: Provide hm_rv_* in hm_create_nothing
Ian Jackson [Sun, 27 Nov 2016 17:18:44 +0000 (17:18 +0000)]
regress: hmacros.i4: Provide hm_rv_* in hm_create_nothing

This is convenient, and it is going to become more so.  No functional
change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw: Fix close return value
Ian Jackson [Sun, 27 Nov 2016 17:30:18 +0000 (17:30 +0000)]
regress: hfuzzraw: Fix close return value

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw: Break out P_succfail()
Ian Jackson [Sun, 27 Nov 2016 17:29:20 +0000 (17:29 +0000)]
regress: hfuzzraw: Break out P_succfail()

Hclose needs it.  No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback fuzzraw generator: Get errno and result generation right
Ian Jackson [Sun, 27 Nov 2016 17:15:50 +0000 (17:15 +0000)]
regress: playback fuzzraw generator: Get errno and result generation right

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback fuzzraw generator: Fix a wrong pointer passed to fwrite
Ian Jackson [Sun, 27 Nov 2016 17:14:11 +0000 (17:14 +0000)]
regress: playback fuzzraw generator: Fix a wrong pointer passed to fwrite

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: Provide for ADNS_TEST_FUZZRAW_STDOUT_ENABLE
Ian Jackson [Sun, 27 Nov 2016 16:32:04 +0000 (16:32 +0000)]
regress: fuzzraw: Provide for ADNS_TEST_FUZZRAW_STDOUT_ENABLE

This generates sort-of-.sys-file output, which is useful for
debugging.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw: Fix a wrong pointer passed to fread
Ian Jackson [Sun, 27 Nov 2016 16:31:36 +0000 (16:31 +0000)]
regress: hfuzzraw: Fix a wrong pointer passed to fread

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw: Fix that Tensurerecordfile was not idempotent
Ian Jackson [Sun, 27 Nov 2016 16:30:57 +0000 (16:30 +0000)]
regress: hfuzzraw: Fix that Tensurerecordfile was not idempotent

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: make1fuzz: Make fuzzraw-* too
Ian Jackson [Sun, 27 Nov 2016 16:26:48 +0000 (16:26 +0000)]
regress: make1fuzz: Make fuzzraw-* too

And clean and .gitignore them.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzz: Do not redirect stdout
Ian Jackson [Sun, 27 Nov 2016 16:25:45 +0000 (16:25 +0000)]
regress: hfuzz: Do not redirect stdout

(And anyway the dup2 was the wrong way round.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Reorganise r1test and make1fuzz some more
Ian Jackson [Sun, 27 Nov 2016 15:20:37 +0000 (15:20 +0000)]
regress: Reorganise r1test and make1fuzz some more

We are going to want make1fuzz to make the raw fuzzer input too.
That's done by the playback programs, so we need to call them.

This means it needs to make a copy of the syscall stream made by
playback_prepare.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback fuzzraw dump: Initial cut of raw file generator
Ian Jackson [Sun, 27 Nov 2016 14:25:46 +0000 (14:25 +0000)]
regress: playback fuzzraw dump: Initial cut of raw file generator

This has not been executed so it may well not work.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback fuzzraw dump: Move Tshutdown
Ian Jackson [Sun, 27 Nov 2016 14:25:08 +0000 (14:25 +0000)]
regress: playback fuzzraw dump: Move Tshutdown

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: fuzzraw: read new fds from stream
Ian Jackson [Sun, 27 Nov 2016 10:54:55 +0000 (10:54 +0000)]
regress: fuzzraw: read new fds from stream

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Make arrangements for fuzzraw of gettimeofday
Ian Jackson [Sun, 27 Nov 2016 10:47:33 +0000 (10:47 +0000)]
regress: Make arrangements for fuzzraw of gettimeofday

Provide a hook to call in Hgettimeofday which is a stub in all but
fuzzraw.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Make special arrangements for close()
Ian Jackson [Sun, 27 Nov 2016 10:09:49 +0000 (10:09 +0000)]
regress: Make special arrangements for close()

fuzzraw wants to track fds, so we can't just pass to through there.

All the other sites get a macro hm_stdsyscall_close to just get
the simple version.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hfuzzraw work in progress
Ian Jackson [Wed, 23 Nov 2016 22:50:26 +0000 (22:50 +0000)]
regress: hfuzzraw work in progress

It compiles. But:
 * close() needs to be handled specially since we are maintaining
   a synthetic fd table
 * it does not work at all yet and probably has other parts missing
 * want to (optionally) generate raw feed as part of playback
 * new fds need to get the chosen fd from the stream (and check
   it for sanity)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Fix a message about length return values
Ian Jackson [Wed, 23 Nov 2016 22:50:15 +0000 (22:50 +0000)]
regress: Fix a message about length return values

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Make fcntl extra arg be int, not long
Ian Jackson [Wed, 23 Nov 2016 22:49:47 +0000 (22:49 +0000)]
regress: Make fcntl extra arg be int, not long

Fixes test suite on platforms where long is not same size as int.
(Although it may work on some LE platforms anyway.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Provide Tnerrnos
Ian Jackson [Wed, 23 Nov 2016 22:46:42 +0000 (22:46 +0000)]
regress: Provide Tnerrnos

No users yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: hplayback: Do not tolerate hm_rv_any values out of range
Ian Jackson [Wed, 23 Nov 2016 17:32:09 +0000 (17:32 +0000)]
regress: hplayback: Do not tolerate hm_rv_any values out of range

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Do not crash if fd set fd out of range
Ian Jackson [Wed, 23 Nov 2016 17:26:09 +0000 (17:26 +0000)]
regress: Do not crash if fd set fd out of range

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Do not provide our own malloc in fuzz mode
Ian Jackson [Wed, 23 Nov 2016 16:44:44 +0000 (16:44 +0000)]
regress: Do not provide our own malloc in fuzz mode

We expect our fuzzer to have a stunt malloc.  So just provide stubs.

This involves moving our malloc wrapper to nonfuzz.c.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Rename Tallocshutdown to Tcommonshutdown
Ian Jackson [Wed, 23 Nov 2016 16:41:05 +0000 (16:41 +0000)]
regress: Rename Tallocshutdown to Tcommonshutdown

No functional change just yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: playback: Do not accept numeric errno values except 1..255
Ian Jackson [Wed, 23 Nov 2016 16:27:58 +0000 (16:27 +0000)]
regress: playback: Do not accept numeric errno values except 1..255

In particular do not accept zero, which the operating system won't
produce.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Provide fuzzcat.d
Ian Jackson [Sat, 19 Nov 2016 19:30:02 +0000 (19:30 +0000)]
regress: Provide fuzzcat.d

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Provide Makefile targets to generate fuzzer inputs
Ian Jackson [Sat, 19 Nov 2016 18:59:10 +0000 (18:59 +0000)]
regress: Provide Makefile targets to generate fuzzer inputs

These will be useful for seeding AFL and may be useful for other
purposes.  This also lets us check that at least with our existing
test cases, the corresponding fuzzer input files work.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This reverts commit 44843c19f7b3ebf59aa4cda4cef9be0f5d973126.

4 months agoregress: Fix skipped tests ($$ reference in Makefile)
Ian Jackson [Sat, 19 Nov 2016 18:59:22 +0000 (18:59 +0000)]
regress: Fix skipped tests ($$ reference in Makefile)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Introduce %_fuzz executables
Ian Jackson [Sat, 19 Nov 2016 18:38:25 +0000 (18:38 +0000)]
regress: Introduce %_fuzz executables

This takes a single input file containing command line arguments,
stdin, and syscall stream, and runs the playback on it.

This will be useful for fuzzers.

Currently nothing calls this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Move Texit into hnonfuzz
Ian Jackson [Sat, 19 Nov 2016 18:40:13 +0000 (18:40 +0000)]
regress: Move Texit into hnonfuzz

We are going to want to do this separately in the fuzz playback.  This
avoids difficulties with adnstest (which calls Texit rather than
Hexit) and programs which return from main(), both of which we want to
capture the exit status of in the fuzz playbacks.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Allow harness code to wrap main if it wants to
Ian Jackson [Sat, 19 Nov 2016 18:24:48 +0000 (18:24 +0000)]
regress: Allow harness code to wrap main if it wants to

The fuzzer is going to want to wrap main().  This is a bit awkward
because everyone defines it their own way (in ways which are obviously
equivalent but which trigger compiler warnings).  Our warnings mean we
have to make sure the comiler sees a declaration.

Luckily the only occurence of main() anywhere in one of the client
programs is (necessarily) the definition of main, which is always
defined to return int.  So we can arrange the expansion to produce
both declaration and definition of Hmain.

Then in hnonfuzz.c we need to declare Hmain.  (Which we can't declare
in the global header file.)  We hope that type errors in main are
unlikely.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Wrap up fopen() too
Ian Jackson [Sat, 19 Nov 2016 18:22:49 +0000 (18:22 +0000)]
regress: Wrap up fopen() too

The fuzzer is going to want to wrap fopen.  So add it to the special
syscall list, and implement it with the obvious wrapper in hnonfuzz.c.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Introduce hnonfuzz.c and Ttestinputfd
Ian Jackson [Sat, 19 Nov 2016 18:19:10 +0000 (18:19 +0000)]
regress: Introduce hnonfuzz.c and Ttestinputfd

We are going to want to build a fuzzer target binary which will be
very like a playback binary, but provides a bit more wrapping.

For now we introduce hnonfuzz.o and link it into all the
currently-generated executables.

To make it not be an empty translation unit, combine this with:

Break out Ttestinputfd from hplayback.c.m4.

Neither of these changes produce any functional change.  (Ttestinputfd
ends up linked into *_record as well as *_playback but this is of no
consequence.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: shlib playback_prepare: Use test -e rather than test -f
Ian Jackson [Sat, 19 Nov 2016 18:11:09 +0000 (18:11 +0000)]
regress: shlib playback_prepare: Use test -e rather than test -f

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Break out some functions from r1test into a new file
Ian Jackson [Sat, 19 Nov 2016 18:02:56 +0000 (18:02 +0000)]
regress: Break out some functions from r1test into a new file

We are going to want to reuse some of this logic for parsing case-*.sys
files.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Break a line in the Makefile.in
Ian Jackson [Sun, 5 Mar 2017 21:26:02 +0000 (21:26 +0000)]
regress: Break a line in the Makefile.in

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: Break out Tallocshutdown
Ian Jackson [Sat, 19 Nov 2016 17:37:56 +0000 (17:37 +0000)]
regress: Break out Tallocshutdown

No functional change

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: m1test: Use test -e rather than test -f
Ian Jackson [Sat, 19 Nov 2016 18:11:03 +0000 (18:11 +0000)]
regress: m1test: Use test -e rather than test -f

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregress: r1test: Use test -e rather than test -f
Ian Jackson [Sat, 19 Nov 2016 18:10:27 +0000 (18:10 +0000)]
regress: r1test: Use test -e rather than test -f

This avoids some silly error messages or other mistakes.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>