[syslinux] filename remapping -> hostip filename prefix?
H. Peter Anvin
hpa at zytor.com
Mon Nov 24 12:31:40 PST 2003
Erik Dykema wrote:
> Mr. Anvin-
> Thanks very much for your response. I have decided to try and fix
> the problem by upgrading the tftp server to tftpd-hpa. Incidentally,
> the guy here at Columbia who has been maintaining our tftpd server,
> Johan Anderson, says that he has been chatting with you in the past, so
> I am merely following in the footsteps of giants.
> One question I have:
> Our tftpd server seems to be a much branch of the same BSD code from
> which you tftpd-hpa server was created. We have made a modification to
> it, however, which produces the following result;
> A machine's IP address is used to prefix it's get request, so that
> when machine 22.214.171.124 requests the filename "/treasure", what it really
> gets out of the filesystem is NOT the file /var/tftp/treasure, but the
> Where "/var/tftp" is the directory specified on the command line or
> in inetd.conf.
> We then have many directories in our /var/tftp directory , some of
> which are links to a 'default' set of images, some of which are more
> particular, which allows us more fine grained control over what certain
> machines see, without having to pass directory names through DHCP.
> I was contemplating attempting to extract this functionality from
> our codebase and merge it into your code base, and came across the
> filename remapping options in your server, which I suspect might be able
> to do exactly what we do. I was looking for an example to confirm, but
> have found none. Do you think that the filename re-mapping stuff could
> be used in this way?
Yes, most definitely. The remapping file you need would look like:
r ^/ /\i/ # Handle /request
r ^([^/]) /\i/\1 # Handle request
(The second line is to handle requests that don't start with a slash.)
More information about the Syslinux