5 Oct 2004 18:06
-hostname option to afpd.conf
Shlomi Yaakobovich <Shlomi <at> exanet.com>
2004-10-05 16:06:51 GMT
2004-10-05 16:06:51 GMT
Hi all,
Below is a patch that adds a -hostname option to the afpd.conf file. It's purpose is to allow afpd to use a
different hostname than the one returned by gethostname(). For example, if gethostname() resolves to a
certain IP address, but the afpd wants to use a different IP address. Using the -ipaddr option provides a
limited solution, since this cannot be done when the host resolution may change (as is the situation in our
system), e.g. from 10.0.0.100 to 10.0.0.101, but the name does not change. I certainly wouldn't want to
change the afpd.conf whenever the IP address I'm using changes...
Shlomi
> diff -u netatalk/etc/afpd/afp_options.c patch/afp_options.c
--- netatalk/etc/afpd/afp_options.c 2004-06-22 11:45:12.000000000 +0300
+++ patch/afp_options.c 2004-10-05 18:02:16.000000000 +0200
<at> <at> -260,6 +260,17 <at> <at>
/* figure out options w/ values. currently, this will ignore the setting
* if memory is lacking. */
+
+ if ((c = getoption(buf, "-hostname"))) {
+ int len = strlen (c);
+ if (len <= MAXHOSTNAMELEN) {
+ memcpy(options->hostname, c, len);
+ options->hostname[len] = 0;
+ }
+ else
+ LOG(log_info, logtype_afpd, "WARNING: hostname %s is too long (%d)",c,len);
(Continue reading)

RSS Feed