chiark / gitweb /
yaid
3 months agoyaid.c: Use new mLib function annotations. master
Mark Wooding [Sun, 23 Jun 2013 22:25:23 +0000]
yaid.c: Use new mLib function annotations.

Update dependency on mLib.

3 months agoyaid.8.in: Fix formatting.
Mark Wooding [Sun, 23 Jun 2013 23:27:53 +0000]
yaid.8.in: Fix formatting.

3 months agoRelease 1.0.1. 1.0.1
Mark Wooding [Sun, 23 Jun 2013 22:32:01 +0000]
Release 1.0.1.

3 months agoFix limits on reading user policy files.
Mark Wooding [Sun, 23 Jun 2013 22:24:17 +0000]
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.

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

It should certainly match `configure.ac'.

3 months agoyaid.h: Avoid the macro name `N'.
Mark Wooding [Sun, 23 Jun 2013 17:01:19 +0000]
yaid.h: Avoid the macro name `N'.

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

11 months agoDebian packaging. 1.0.0
Mark Wooding [Sun, 21 Oct 2012 15:25:53 +0000]
Debian packaging.

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

11 months agolinux.c, yaid.c: Correct policy application for proxied queries.
Mark Wooding [Sun, 21 Oct 2012 14:52:25 +0000]
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 months agoyaid.8.in: Add manual page.
Mark Wooding [Sun, 21 Oct 2012 14:49:58 +0000]
yaid.8.in: Add manual page.

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

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

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

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

11 months agopolicy.h, yaid.h: Allow policy rules to match on the user.
Mark Wooding [Sun, 21 Oct 2012 14:05:20 +0000]
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 months agopolicy.c: Check that the input file is a proper file.
Mark Wooding [Sun, 21 Oct 2012 14:02:46 +0000]
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 months agopolicy.h: Don't allow `user' actions in user policy files.
Mark Wooding [Sun, 21 Oct 2012 14:01:36 +0000]
policy.h: Don't allow `user' actions in user policy files.

The turtles will overwhelm us.

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

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

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

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

Nothing outside needs to know about it any more.

11 months agoyaid.c: Reorder `proxy_query': don't use `c' after `conn_init'.
Mark Wooding [Sat, 20 Oct 2012 12:54:12 +0000]
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 months agoyaid.c: Common function for fixing connected sockets.
Mark Wooding [Sat, 20 Oct 2012 12:51:57 +0000]
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 months agoyaid.c: Beef up `reply' with an extra token argument.
Mark Wooding [Sat, 20 Oct 2012 12:35:21 +0000]
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 months 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]
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 months 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]
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 months agolinux.c (identify): Don't leak the file handle.
Mark Wooding [Thu, 18 Oct 2012 09:23:45 +0000]
linux.c (identify): Don't leak the file handle.

11 months agoDispatch to methods handling address-family specifics.
Mark Wooding [Wed, 17 Oct 2012 23:11:56 +0000]
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 months agoMakefile.am, configure.ac, ident.c -> linux.c: System specifics.
Mark Wooding [Wed, 17 Oct 2012 23:09:00 +0000]
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 months 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]
ident.c, yaid.c, yaid.h: Make `get_default_gw' be internal to `ident.c'.

Don't really need the diagnostics any more.

11 months agoyaid.c: Don't fail if either IPv4 or IPv6 is unavailable.
Mark Wooding [Wed, 17 Oct 2012 04:39:41 +0000]
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 months agopolicy.c: Implement IPv6 matching in match_addrpat.
Mark Wooding [Wed, 17 Oct 2012 04:42:09 +0000]
policy.c: Implement IPv6 matching in match_addrpat.

Missing piece.  Whoops.

11 months agoApparently working version, but still ugly.
Mark Wooding [Sun, 14 Oct 2012 23:21:21 +0000]
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.

12 months agoInitial ugly non-portable core of an ident daemon.
Mark Wooding [Sat, 29 Sep 2012 14:37:27 +0000]
Initial ugly non-portable core of an ident daemon.