=== modified file 'debian/mandos-client.README.Debian' --- debian/mandos-client.README.Debian 2011-10-05 16:00:56 +0000 +++ debian/mandos-client.README.Debian 2011-11-27 02:32:20 +0000 @@ -51,6 +51,11 @@ disk environment, the network interface *must* exist at that stage. Thus, the interface can *not* be a pseudo-interface such as "br0" or "tun0"; instead, only real interface (such as "eth0") can be used. + This can be overcome by writing a "network hook" program (see + mandos-client(8mandos)) and placing it in + "/etc/mandos/network-hooks.d", from where it will be copied into the + initial RAM disk. Some example network hook scripts can be found in + "/usr/share/doc/mandos-client/network-hooks.d". * User-Supplied Plugins @@ -84,4 +89,4 @@ work, "--options-for=mandos-client:--connect=
:" needs to be manually added to the file "/etc/mandos/plugin-runner.conf". - -- Teddy Hogeborn , Wed, 5 Oct 2011 17:50:22 +0200 + -- Teddy Hogeborn , Sun, 27 Nov 2011 03:30:40 +0100 === modified file 'debian/mandos-client.docs' --- debian/mandos-client.docs 2008-10-18 11:17:22 +0000 +++ debian/mandos-client.docs 2011-11-27 02:32:20 +0000 @@ -1,3 +1,4 @@ NEWS README TODO +network-hooks.d === modified file 'initramfs-tools-hook' --- initramfs-tools-hook 2011-11-13 20:49:21 +0000 +++ initramfs-tools-hook 2011-11-27 02:32:20 +0000 @@ -116,7 +116,7 @@ esac # Copy any files needed by the network hook MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \ - "$hook" files | while read file target; do + VERBOSITY=0 "$hook" files | while read file target; do if [ -z "${target}" ]; then copy_exec "$file" else === modified file 'plugins.d/mandos-client.xml' --- plugins.d/mandos-client.xml 2011-11-13 20:49:21 +0000 +++ plugins.d/mandos-client.xml 2011-11-27 02:32:20 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -102,7 +102,8 @@ - + @@ -147,6 +148,26 @@ will wait indefinitely for new servers to appear. + The network interface is selected like this: If an interface is + specified using the option, that + interface is used. Otherwise, &COMMANDNAME; + will choose any interface that is up and running and is not a + loopback interface, is not a point-to-point interface, is + capable of broadcasting and does not have the NOARP flag (see + netdevice + 7). (If the + option is used, point-to-point + interfaces and non-broadcast interfaces are accepted.) If no + acceptable interfaces are found, re-run the check but without + the up and running requirement, and manually take + the selected interface up (and later take it down on program + exit). + + + Before a network interface is selected, all network + hooks are run; see . + + This program is not meant to be run directly; it is really meant to run as a plugin of the Mandos plugin-runner @@ -227,7 +248,8 @@ can not be a pseudo-interface such as br0 or tun0; such interfaces will not exist until much later in the boot process, and can not be used - by this program. + by this program, unless created by a network + hook — see . NAME can be the string @@ -393,8 +415,10 @@ plugin-runner 8mandos) is used to run both this program and others in in parallel, - one of which will prompt for passwords on - the system console. + one of which ( + password-prompt + 8mandos) will prompt for + passwords on the system console. @@ -421,6 +445,144 @@ + + NETWORK HOOKS + + If a network interface like a bridge or tunnel is required to + find a Mandos server, this requires the interface to be up and + running before &COMMANDNAME; starts looking + for Mandos servers. This can be accomplished by creating a + network hook program, and placing it in a special + directory. + + + Before the network is used (and again before program exit), any + runnable programs found in the network hook directory are run + with the argument start or + stop. This should bring up or + down, respectively, any network interface which + &COMMANDNAME; should use. + + + REQUIREMENTS + + A network hook must be an executable file, and its name must + consist entirely of upper and lower case letters, digits, + underscores, and hyphens. + + + A network hook will receive one argument, which can be one of + the following: + + + + start + + + This should make the network hook create (if necessary) + and bring up a network interface. + + + + + stop + + + This should make the network hook take down a network + interface, and delete it if it did not exist previously. + + + + + files + + + This should make the network hook print, on + separate lines, all the files needed for it + to run. (These files will be copied into the initial + RAM filesystem.) Intended use is for a network hook + which is a shell script to print its needed binaries. + + + It is not necessary to print any non-executable files + already in the network hook directory, these will be + copied implicitly if they otherwise satisfy the name + requirement. + + + + + + The network hook will be provided with a number of environment + variables: + + + + MANDOSNETHOOKDIR + + + The network hook directory, specified to + &COMMANDNAME; by the + option. Note: this + should always be used by the + network hook to refer to itself or any files it may + require. + + + + + DEVICE + + + The network interface, as specified to + &COMMANDNAME; by the + option. If this is not the + interface a hook will bring up, there is no reason for a + hook to continue. + + + + + MODE + + + This will be the same as the first argument; + i.e. start, + stop, or + files. + + + + + VERBOSITY + + + This will be the 1 if + the option is passed to + &COMMANDNAME;, otherwise + 0. + + + + + DELAY + + + This will be the same as the + option passed to &COMMANDNAME;. + + + + + + A hook may not read from standard input, and should be + restrictive in printing to standard output or standard error + unless VERBOSITY is + 1. + + + + FILES @@ -438,6 +600,17 @@ + + /lib/mandos/network-hooks.d + + + Directory where network hooks are located. Change this + with the option. See + . + + +