chiark / gitweb /
yaid
10 years agoRelease 1.0.1. 1.0.1
Mark Wooding [Sun, 23 Jun 2013 22:32:01 +0000 (23:32 +0100)]
Release 1.0.1.

10 years agoFix limits on reading user policy files.
Mark Wooding [Sun, 23 Jun 2013 22:24:17 +0000 (23:24 +0100)]
Fix limits on reading user policy files.

The old code only checked the line code after a successful policy line.
A policy file consisting only of blank lines, comments, and erroneous
lines could cause the daemon to loop forever.

Modify `read_policy_file' to return `T_*' codes (like the comment says
it should!), and handle the various codes in the caller.  Most
particularly, `client_line' gives up after the first error to avoid
spamming the log.  Getting this to work properly involves applying a
different ordering to the `T_*' codes.

10 years agodebian/control: Fix Build-Depends on `mlib-dev'.
Mark Wooding [Sun, 23 Jun 2013 22:19:05 +0000 (23:19 +0100)]
debian/control: Fix Build-Depends on `mlib-dev'.

It should certainly match `configure.ac'.

10 years agoyaid.h: Avoid the macro name `N'.
Mark Wooding [Sun, 23 Jun 2013 17:01:19 +0000 (18:01 +0100)]
yaid.h: Avoid the macro name `N'.

Rename the helper macros of `RESPONSE' to `U_' and `N_'.

11 years agoDebian packaging. 1.0.0
Mark Wooding [Sun, 21 Oct 2012 15:25:53 +0000 (16:25 +0100)]
Debian packaging.

11 years agopolicy.c, yaid.c: Silently ignore missing user policy files.
Mark Wooding [Sun, 21 Oct 2012 21:30:26 +0000 (22:30 +0100)]
policy.c, yaid.c: Silently ignore missing user policy files.

11 years agolinux.c, yaid.c: Correct policy application for proxied queries.
Mark Wooding [Sun, 21 Oct 2012 14:52:25 +0000 (15:52 +0100)]
linux.c, yaid.c: Correct policy application for proxied queries.

The apparent remote address for a proxy connection is the gateway, but
in fact the information is going to some remote server.  Therefore, once
we've identified a proxy connection, overwrite the remote address in
the query with the true remote host.

This means fixing up the query structure with the gateway address next
time, so keep track of the connection remote address and restore it on
each query.

11 years agoyaid.8.in: Add manual page.
Mark Wooding [Sun, 21 Oct 2012 14:49:58 +0000 (15:49 +0100)]
yaid.8.in: Add manual page.

11 years agoMakefile.am: Include `confsubst' machinery.
Mark Wooding [Sun, 21 Oct 2012 14:12:41 +0000 (15:12 +0100)]
Makefile.am: Include `confsubst' machinery.

11 years agoconfigure.ac, yaid.c: Make it be a proper Unix daemon.
Mark Wooding [Sun, 21 Oct 2012 14:10:46 +0000 (15:10 +0100)]
configure.ac, yaid.c: Make it be a proper Unix daemon.

Forks into background, drops privilege, proper logging, and all the usual
trappings.

11 years agoyaid.c: Time out idle connections after 30s.
Mark Wooding [Sun, 21 Oct 2012 14:08:30 +0000 (15:08 +0100)]
yaid.c: Time out idle connections after 30s.

11 years agopolicy.h, yaid.h: Allow policy rules to match on the user.
Mark Wooding [Sun, 21 Oct 2012 14:05:20 +0000 (15:05 +0100)]
policy.h, yaid.h: Allow policy rules to match on the user.

So we have a user pattern, and all the associated bits and pieces.
This breaks old policy files, but nobody has deployed yet.

11 years agopolicy.c: Check that the input file is a proper file.
Mark Wooding [Sun, 21 Oct 2012 14:02:46 +0000 (15:02 +0100)]
policy.c: Check that the input file is a proper file.

This is mainly useful for user policy files, to make sure they're not
completely mad.

11 years agopolicy.h: Don't allow `user' actions in user policy files.
Mark Wooding [Sun, 21 Oct 2012 14:01:36 +0000 (15:01 +0100)]
policy.h: Don't allow `user' actions in user policy files.

The turtles will overwhelm us.

11 years agoGeneral spring-cleaning. Most of the code is pretty nice now.
Mark Wooding [Sat, 20 Oct 2012 17:30:21 +0000 (18:30 +0100)]
General spring-cleaning.  Most of the code is pretty nice now.

11 years agolinux.c: Remove stray debugging code.
Mark Wooding [Sat, 20 Oct 2012 14:31:44 +0000 (15:31 +0100)]
linux.c: Remove stray debugging code.

11 years agolinux.c: Do NAT detection using address-independent machinery.
Mark Wooding [Sat, 20 Oct 2012 14:28:55 +0000 (15:28 +0100)]
linux.c: Do NAT detection using address-independent machinery.

11 years agolinux.c: Mark `get_default_gw' as static.
Mark Wooding [Sat, 20 Oct 2012 12:55:30 +0000 (13:55 +0100)]
linux.c: Mark `get_default_gw' as static.

Nothing outside needs to know about it any more.

11 years agoyaid.c: Reorder `proxy_query': don't use `c' after `conn_init'.
Mark Wooding [Sat, 20 Oct 2012 12:54:12 +0000 (13:54 +0100)]
yaid.c: Reorder `proxy_query': don't use `c' after `conn_init'.

It might have been freed if the connection completes immediately (so
`proxy_connected' is called synchronously) and then something goes
wrong (so `c' will be freed).

11 years agoyaid.c: Common function for fixing connected sockets.
Mark Wooding [Sat, 20 Oct 2012 12:51:57 +0000 (13:51 +0100)]
yaid.c: Common function for fixing connected sockets.

Previously I'd forgotten to drag `out-of-band' data inline, which will
cause a select(2) spin, and to make the client connection be nonblocking.
Put all of the relevant stuff in a utility function.

11 years agoyaid.c: Beef up `reply' with an extra token argument.
Mark Wooding [Sat, 20 Oct 2012 12:35:21 +0000 (13:35 +0100)]
yaid.c: Beef up `reply' with an extra token argument.

Eliminates the need for `proxy_line' to call `write_to_client' explicitly,
duplicating functionality.

11 years agolinux.c, yaid.c, yaid.h: Open the NAT table just once at init time.
Mark Wooding [Thu, 18 Oct 2012 09:35:35 +0000 (10:35 +0100)]
linux.c, yaid.c, yaid.h: Open the NAT table just once at init time.

This file requires privileges to open, so it must be done before we
drop them.  (We don't, yet, but it's coming.)

11 years agoaddr.c, linux.h, yaid.h: Move things out of the address-type list macro.
Mark Wooding [Thu, 18 Oct 2012 09:27:28 +0000 (10:27 +0100)]
addr.c, linux.h, yaid.h: Move things out of the address-type list macro.

Things which are only needed to initialize the table are now in
systematically named macros which are determined by the table population
machinery.  This means we can build the system-specific operations
table in the same way.

11 years agolinux.c (identify): Don't leak the file handle.
Mark Wooding [Thu, 18 Oct 2012 09:23:45 +0000 (10:23 +0100)]
linux.c (identify): Don't leak the file handle.

11 years agoDispatch to methods handling address-family specifics.
Mark Wooding [Wed, 17 Oct 2012 23:11:56 +0000 (00:11 +0100)]
Dispatch to methods handling address-family specifics.

This is a fairly invasive change to the program.  Rather than carry
around an address family type and switch on it throughout, carry around
a pointer to a vtable containing methods.  Methods needed by the system-
specific machinery are properly integrated.

11 years agoMakefile.am, configure.ac, ident.c -> linux.c: System specifics.
Mark Wooding [Wed, 17 Oct 2012 23:09:00 +0000 (00:09 +0100)]
Makefile.am, configure.ac, ident.c -> linux.c: System specifics.

Rename `ident.c' to indicate that this is where the system-specific
machinery lives, and provide build system support for other platforms
should they be contributed.

11 years agoident.c, yaid.c, yaid.h: Make `get_default_gw' be internal to `ident.c'.
Mark Wooding [Wed, 17 Oct 2012 04:40:57 +0000 (05:40 +0100)]
ident.c, yaid.c, yaid.h: Make `get_default_gw' be internal to `ident.c'.

Don't really need the diagnostics any more.

11 years agoyaid.c: Don't fail if either IPv4 or IPv6 is unavailable.
Mark Wooding [Wed, 17 Oct 2012 04:39:41 +0000 (05:39 +0100)]
yaid.c: Don't fail if either IPv4 or IPv6 is unavailable.

Do continue to fail if the ports can't be bound, or if neither protocol
is available.

11 years agopolicy.c: Implement IPv6 matching in match_addrpat.
Mark Wooding [Wed, 17 Oct 2012 04:42:09 +0000 (05:42 +0100)]
policy.c: Implement IPv6 matching in match_addrpat.

Missing piece.  Whoops.

11 years agoApparently working version, but still ugly.
Mark Wooding [Sun, 14 Oct 2012 23:21:21 +0000 (00:21 +0100)]
Apparently working version, but still ugly.

It needs a lot of commentary, a proper command-line interface, logging,
pidfiles, and so on.

Also, there's a bunch of inconsistency surrounding IPv4/IPv6 handling:
the core uses a vtable, while most of the rest of the code uses
switches.  This ought to be sorted out before a proper release.

11 years agoInitial ugly non-portable core of an ident daemon.
Mark Wooding [Sat, 29 Sep 2012 14:37:27 +0000 (15:37 +0100)]
Initial ugly non-portable core of an ident daemon.