Mon Nov 6 14:05:40 2000 Nick Burrett * domain.c (domain_add): Fix several malloc/free errors: mail_addr was declared with a buffer too small. ns1 and ns2 were not freed. ipaddr should not have been freed. Moved scope of zonename. Mon Nov 6 10:53:00 2000 Nick Burrett * domain.c (domain_modifyvs): Renamed from domain_renamevs. Use getopt for argument processing. Allow primary/secondary nameserver and also quota to be changed. (webdns_setquota): Delete function. Functionality has been merged into domain_modifyvs. * mod_webdns.c (clist): Delete CMD_WEBDNS_RENAMEVS and CMD_WEBDNS_SETQUOTA. Add CMD_WEBDNS_MODIFYVS. (mod_webdns_cmd): Likewise. Add argc parameter. * mod_webdns.h (CMD_WEBDNS_RENAMEVS): Delete macro. (CMD_WEBDNS_SETQUOTA): Delete macro. (CMD_WEBDNS_MODIFYVS): Add macro. * webdns.h (domain_renamevs): Delete decl. (webdns_setquota): Delete decl. (domain_modifyvs): Add decl. Fri Nov 3 12:54:23 2000 Nick Burrett * webdns.h: Don't include stdarg.h. (WEBDNS_DB, WEBDNS_EXCL_DB): For HAVE_NDBM_H, don't add `.db' suffix because the ndbm library automatically does this. * dbase.c: Include stdarg.h. (webdns_dbase_open): For ndbm, open with O_EXCL and O_RDWR. O_WRONLY was invalid. * domain.c: Include stdarg.h. * mod_webdns.c: Include stdarg.h. * parse.y: Include stdarg.h. Thu Nov 2 16:41:14 2000 Nick Burrett * dbase.c (webdns_dbase_excl_add): Don't barf if db can't be found. * domain.c (domain_restorevs): New function. * mod_webdns.c (clist): Add WEBDNS_RESTOREVS. Change syntax of WEBDNS_ADDVS. (mod_webdns_cmd): Support WEBDNS_RESTOREVS. * mod_webdns.h (CMD_WEBDNS_RESTOREVS): New define. * webdns.h (domain_restorevs): Add declaration. Thu Nov 2 07:45:41 2000 Nick Burrett * mod_webdns.c (mod_webdns_check_cmd): New function. (mod_webdns_syntax, mod_webdns_list_help): Delete functions. (webdns_module): Delete mod_webdns_list_help reference. (mod_webdns_cmd): vsd_server argument is now void *. Fri Sep 15 14:59:41 2000 Nick Burrett * protocol.txt: Add description of WEBDNS_SETQUOTA, WEBDNS_SETTTL, WEBDNS_RELOAD. Add ip argument to WEBDNS_ADDVS. Fri Sep 15 14:44:13 2000 Nick Burrett * domain.c (webdns_setquota): New function. * mod_webdns.c (clist): Add WEBDNS_SETQUOTA. (mod_webdns_cmd): Add WEBDNS_SETQUOTA. * mod_webdns.h (CMD_WEBDNS_SETQUOTA): New macro. * webdns.h (webdns_setquota): Add declaration. Fri Sep 15 13:25:34 2000 Nick Burrett * dbase.c (webdns_dbase_open): Remove file existence check. Fri Sep 15 12:56:40 2000 Nick Burrett * mod_webdns.c (mod_webdns_cmd): Fix broken CMD_WEBDNS_MODIFY by using vsd_read_file to read file into buffer, prior to sending via vsd_send_command. * zone.c (zone_find_resource_record): Canonicalise `domain' and `server' since the client may pass data in the other form. Thu Sep 14 14:30:49 2000 Nick Burrett * domain.c (domain_fix): Don't strdup result from vsd_map_server_root. (domain_fixall, domain_ipmod, domain_ipmodall): Likewise. (domain_renamevs): Likewise. Thu Sep 14 11:28:24 2000 Nick Burrett * mod_webdns.c (clist): Fix description of WEBDNS_ADD. (mod_webdns_cmd): Support optional e-mail arg to WEBDNS_ADD. Thu Sep 14 11:25:48 2000 Nick Burrett FreeBSD compile fixes. * Makefile.in (BISON): Delete. (YACC): Define. (parse.c): Use $(YACC) instead of calling `bison'. * configure.in: Don't check for bison. Add AC_PROG_YACC. Add header check for gdbm.h and ndbm.h. * dbase.c: Re-structure. (webdns_dbase_open): Support GDBM and NDBM libraries. (webdns_dbase_close, webdns_dbase_lookup): Likewise. (webdns_dbase_delete, webdns_dbase_add): Likewise. (webdns_dbase_firstkey): New function. (webdns_dbase_nextkey): New function. (webdns_dbase_strerror): New function. (webdns_dbase_excl_list): Improve portability by using webdns_dbase_* functions rather than calling gdbm_* functions directly. (webdns_dbase_excl_add): Likewise. (webdns_dbase_excl_delete): Likewise. * webdns.h: Add DB_WRCREAT. Tue Sep 12 13:59:45 2000 Nick Burrett * domain.c (domain_renamevs): Set vc->vs before calling webdns_namedgen. Tue Sep 5 16:42:32 2000 Nick Burrett * mod_webdns.c (mod_webdns_cmd [VSD_LIB]): Fix argv params in call to WEBDNS_RENAMEVS. Mon Sep 4 14:28:10 2000 Nick Burrett * mod_webdns/domain.c (domain_renamevs): Free memory allocated to domainv. (webdns_set_ttl): Log the change to syslog. Notify named of the change. Free memory allocated to domainv. (webdns_reload): New function. * mod_webdns.c (clist): Add CMD_WEBDNS_RELOAD. (mod_webdns_cmd [VSD_LIB]): Initialise `status'. Add CMD_WEBDNS_RELOAD. (mod_webdns_cmd [!VSD_LIB]): Add CMD_WEBDNS_RELOAD. * mod_webdns.h (CMD_WEBDNS_RELOAD): Define. * webdns.h (webdns_reload): Add declaration. Wed Aug 30 12:27:54 2000 Nick Burrett * mod_webdns/mod_webdns.c (mod_webdns_check_syntax): Allow for a variable number of arguments. Wed Aug 30 08:56:08 2000 Nick Burrett * mod_webdns/Makefile.in (mod_webdns_lib.o): Build from mod_webdns.c. (mod_webdns.o, mod_webdns_lib.o): Combine into one dependency. * mod_webdns/mod_webdns_lib.c: Delete file. * mod_webdns/mod_webdns.c (clist): New command_tag struct. This is a combined version of mod_webdns_command_table and mod_webdns_command_list. (mod_webdns_command_table): Delete struct. (mod_webdns_check_syntax): Support WEBDNSD and WEBDNSDADM versions. (mod_webdns_list_help [WEBDNSD_LIB]): Taken from mod_webdns_lib.c. (mod_webdns_cmd [WEBDNSD_LIB]): From mod_webdns_lib.c::mod_webdns_do_cmd. (mod_webdns_cmd [! WEBDNSD_LIB]): Renamed from mod_webdns_transaction. (webdns_module): Call mod_webdns_cmd. Tue Aug 29 10:37:55 2000 Nick Burrett * domain.c (domain_renamevs): Notify the name server as soon as a zone file's IP has changed. Sun Aug 27 12:52:21 2000 Nick Burrett * named.c (webdns_named_notify_update): Set stdin and stdout to /dev/null. Fri Aug 25 15:26:26 2000 Nick Burrett * named.c (webdns_named_notify_update): Enable call to ndc reload. Thu Aug 24 16:15:35 2000 Nick Burrett * dbase.c (populate): Delete function. (webdns_dbase_generate): Move functionality of populate into here. Use webdns_dir_get_domains to get domain list. Tue Aug 22 11:13:14 2000 Nick Burrett * dir.c (webdns_dir_named_gen): Fix buffer overflow. Use full path when deleting files. Fri Aug 18 13:01:45 2000 Nick Burrett * domain.c (domain_add): Fix off-by-one error when rejecting domains starting mail. and smtp.. * mod_webdns_lib.c (mod_webdns_command_table): Fix syntax and description of webdns_add. Wed Aug 16 13:18:18 2000 Nick Burrett * mod_webdns_lib.c (mod_webdns_command_lib): Fix syntax description and argument count for webdns_addvs. (mod_webdns_do_cmd): Ensure IP address is passed to WEBDNS_ADDVS. Wed Aug 16 12:22:05 2000 Nick Burrett * dir.c (webdns_dir_named_gen): Don't delete entries from vsd.conf. Wed Aug 16 11:17:38 2000 Nick Burrett * dir.c (webdns_dir_count_domains): Recursively count zone files in directories. Wed Aug 16 11:10:32 2000 Nick Burrett * domain.c (webdns_named_gen): For the secondary nameserver, we should be obtaining the IP for the primary nameserver. Wed Aug 16 11:09:21 2000 Nick Burrett * dir.c (webdns_dir_count_domains): Only count zone files that begin `db.'. Wed Aug 16 10:48:24 2000 Nick Burrett * domain.c (domain_deletevs): Allow a VS account to be deleted even if the directory doesn't exist or cannot be renamed. Wed Aug 16 10:39:58 2000 Nick Burrett * domain.c (webdns_root_named_gen): Fix typo in last change. * mod_webdns.c (mod_webdns_command_table): WEBDNS_ADDVS takes a minimum of 3 arguments. (mod_webdns_check_syntax): Accept a variable number of arguments. Tue Aug 15 02:49:47 2000 Nick Burrett * domain.c (webdns_root_named_gen): Skip entries that start with a dot. Tue Aug 15 02:34:36 2000 Nick Burrett * domain.c (webdns_named_gen): Use global secondary ns if virtual server specific is undefined. Tue Aug 15 02:23:04 2000 Nick Burrett * domain.c (webdns_root_named_gen): Fix named.conf path. * mod_webdns_lib.c (mod_webdns_command_lib): webdns_namedgen takes two arguments. Mon Aug 14 14:03:11 2000 Nick Burrett * domain.c (domain_delete): Re-generate named.conf. (domain_add): Re-generate the master named.conf if when adding a domain we are creating a new virtual server directory. (domain_fixall, domain_ipmodall): Use %m rather than strerror. (webdns_root_named_gen): Fix pathname in include directive. Thu Aug 10 13:34:21 2000 Nick Burrett * domain.c (webdns_root_named_gen): Use info in vsd.conf to create locations for each virtual server directory. Wed Aug 2 15:12:53 2000 Nick Burrett * domain.c (domain_fix): Add dot to domain so that zone file gets saved out with the correct origin and therefore in abbreviated form. (domain_ipmod, domain_ipmodall): Likewise. (domain_renamevs): Likewise. Don't free path returned by vsd_map_server_root. Set vc->virtual_server, when the virtual server name has changed. (webdns_set_ttl): New function. * mod_webdns.c (mod_webdns_command_table): Add WEBDNS_SETTTL. Fix params for WEBDNS_RENAMEVS. (mod_webdns_transaction): Add CMD_WEBDNS_SETTTL. * mod_webdns.h (CMD_WEBDNS_SETTTL): Define. * mod_webdns_lib.c (mod_webdns_command_table): Add webdns_setttl. Fix params for webdns_renamevs. (mod_webdns_do_cmd): WEBDNS_NAMEDGEN takes no parameters. Fix params for WEBDNS_RENAMEVS. Add CMD_WEBDNS_SETTTL. * webdns.h (webdns_set_ttl): Add declaration. Wed Aug 2 14:14:25 2000 Nick Burrett * domain.c (add_dot): Lowercase domains. (domain_delete): Lowercase domain in argv. Use it. (domain_add): Likewise. (domain_modify): Likewise. (add_record): Lowercase the origin and any server names. Thu Jul 27 15:57:42 2000 Nick Burrett * dir.c (webdns_dir_get_domains): Set errno to ENOENT if there are no domains. * domain.c (what_are_we): Add support for name servers in vsd.conf written as IP addresses. (list_domains): Don't produce an error if there are no domains. (domain_add): Use the default primary/secondary name servers if the VS doesn't define it's own. Add a dot to the name server names. Wed Jul 26 10:52:53 2000 Nick Burrett * protocol.txt: Document the protocol for WebDNS. Wed Jul 26 10:52:06 2000 Nick Burrett Upgrade to FreeVSD 1.4.2. Information in /etc/vsd.conf is now more extensive and we can store the default primary/secondary name server information for each account in there. This simplifies the protocol because we no longer need to pass the name server information in the protocol. The directory structure has also been changed to support a very large (>50000) number of domains. Rather than storing these in one directory, they are split into 36 sub-directories (0-9 and a-z). * Makefile.in (OBJS): Add dir.o and named.o. (dir.o): Add dependencies. (named.o): Add dependencies. * domain.c (what_are_we): New function. (host_exists): Delete function. (check_domain_name): Allow domains of up-to 63 characters. Accept domains with `--' sequence. (check_origin): Accept wildcard domains. Take `domain' as an extra parameter. (check_dir_structure): Delete function. (get_domains): Delete function. (make_filename): Delete function. (lowercase): New function. (domain_add): Enfore a quota on domains to be added. Don't take name server info on command line. Use `what_are_we' to discover whether we are the master or slave name server. No need to call `host_exists'. Get name server info. from vsd.conf. Use webdns_dir* rather than make_filename. (add_record, delete_record): Fixup call to check_origin. (domain_modify): Use webdns_dir_* rather than make_filename. Free zonename in a few more places - fixes a memory leak. (domain_fix, domain_fixall, domain_ipmod, domain_ipmodall): Likewise. (domain_addvs): Accept ip, ns1 and ns2 as protocol arguments. Pass to vsd_map_add_server. (domain_renamevs): Validate old and new virtual server names. Allow a virtual server IP address to be changed. (webdns_disablevs): New function. (webdns_enablevs): New function. * dir.c: New file. * domain.c (webdns_namedgen): Re-written. Doesn't take any arguments. Use webdns_dir_* to do all the hard work. Work with new directory structure. When a directory contains no domains, make sure the named.conf gets deleted. (webdns_root_named_gen): Fix to work with new directory structure. * domain.c (list_domains): Warn if access made to a disabled account. (domain_delete, domain_get, domain_add, domain_modify): Likewise. * domain.c (domain_add, domain_modify, domain_delete): Log to syslog whenever a domain is altered. * mod_webdns.c (mod_webdns_command_table): WEBDNS_ADD, WEBDNS_NAMEDGEN, WEBDNS_ADDVS, WEBDNS_RENAMEVS take a different set of arguments. WEBDNS_IPMOD is now ADMIN_VS. * mod_webdns_lib.c (mod_webdns_command_table): Likewise. (mod_webdns_do_cmd): Fixup accordingly. * webdns.h (webdns_disablevs): Add decl. (webdns_enablevs): Add decl. (webdns_dir_count_domains, webdns_dir_get_domains): Add decl. (webdns_dir_name, webdns_dir_named_gen): Add decl. (webdns_dir_domain_add, webdns_dir_domain_delete): Add decl. * named.c: New file. * domain.c (domain_add, domain_delete, domain_modify): Support dynamic DNS updating. As soon as a domain has been modified, send an notification to the name server for immediate reload. Wed Mar 29 16:46:12 2000 Nick Burrett * Makefile.in: Make all object files depend on vsd.h. Store virtual servers in /etc/vsd.conf and use this information to work out the virtual server directory. This improves the security of the protocol and simplifies the code a bit. The `dns' directory becomes obsolete and we can remove the hard coded /var/named/host paths. * dbase.c (webdns_dbase_open): Add explicit check for the existence of the database file before attempting to open it with gdbm. (webdns_dbase_excl_list): Likewise but also store an error. (webdns_dbase_excl_add): Likewise. (webdns_dbase_excl_delete): Likewise. (webdns_dbase_check): New function to simplify name checks. * domain.c (zone_path): Delete function. Replace all callers with vc->server_root. (check_dir_structure): Simplify. Use vc->server_root rather than a hard coded path. (get_domains): Delete argument `server'. Add `vc' argument. Read domains from vc->server_root. Fix all callers. (list_domains): Fix call to get_domains. (domain_delete): Use webdns_dbase_check. (domain_get): No longer takes virtual-server as a command argument. Adjust argv references appropriately. Use vc->server_root in make_filename. (domain_add_primary, domain_add_secondary): Merge functions ... (domain_add): ... and call them domain_add. Add additional check to ensure the user doesn't add a domain name with www, smtp, mail or ftp tacked onto the front (this is a common occurance). (domain_modify): No longer takes virtual-server as a command. (domain_fix): Obtain virtual server directory from command argument. (domain_fixall): Likewise. (domain_ipmod): Likewise. (domain_ipmodall): Likewise. (webdns_named_gen): Fix. (domain_deletevs): Fix. Delete virtual server entry from /etc/vsd.conf. (domain_addvs): New function. (domain_renamevs): Simplify. Rename virtual server in /etc/vsd.conf. * mod_webdns.c (mod_webdns_command_table): WEBDNS_LIST, WEBDNS_DELETE, WEBDNS_GET, WEBDNS_NAMEDGEN, WEBDNS_MODIFY commands no longer take virtual server argument and are changed to ADMIN_VS. WEBDNS_ADD is a new command. Delete WEBDNS_ADDPRI and WEBDNS_ADDSEC commands. WEBDNS_ADDVS, WEBDNS_DELETEVS are new commands. (mod_webdns_transaction): Delete WEBDNS_ADDPRI and WEBDNS_ADDSEC. Add WEBDNS_ADD, WEBDNS_ADDVS and WEBDNS_DELETEVS. * mod_webdns.h (CMD_WEBDNS_ADDPRI): Delete. (CMD_WEBDNS_ADDSEC): Delete. (CMD_WEBDNS_ADD): New. (CMD_WEBDNS_ADDVS): New. * mod_webdns_lib.c (mod_webdns_command_list): Commands webdns_list, webdns_add, webdns_get, webdns_namedgen and webdns_modify are now ADMIN_VS commands. Delete webdns_addpri and webdns_addsec. Add webdns_add, webdns_addvs and webdns_deletevs. (mod_webdns_do_cmd): Add CMD_WEBDNS_ADD. Delete CMD_WEBDNS_ADDPRI and CMD_WEBDNS_ADDSEC. * webdns.h (domain_add_secondary): Delete decl. (domain_add_primary): Delete decl. (domain_add): Add decl. (domain_addvs): Add decl. (domain_deletevs): Add decl. (webdns_dbase_check): Add decl. Fri Mar 24 16:34:36 2000 Nick Burrett * domain.c (domain_renamevs): Check destination directory doesn't exist. Wed Mar 22 15:00:37 2000 Nick Burrett * domain.c (webdns_root_named_gen): Terminate line with a semi-colon. Wed Mar 22 14:48:24 2000 Nick Burrett * domain.c (check_dir_structure): Call webdns_root_named_gen rather than adding an include line to /etc/named.conf. Add `vc' as a parameter. Fix all callers. Wed Mar 22 14:45:11 2000 Nick Burrett * mod_webdns_lib.c (mod_webdns_command_list): Add webdns_rootnamedgen. (mod_webdns_do_cmd): Add CMD_WEBDNS_ROOTNAMEDGEN. Wed Mar 22 13:54:12 2000 Nick Burrett * domain.c (fix_zone): Set the expire and retry defaults for an SOA. Thu Mar 16 15:52:25 2000 Nick Burrett * domain.c (zone_path): Don't accept account names greater than 64 characters. (param): Tidy up. (check_origin): Fix formatting of a comment. (domain_deletevs): Return error message if rename fails. (domain_renamevs): New function. * zone.c (strip_origin): When stripping origin from a fqdn, ensure character before origin is a dot. * mod_webdns.c (mod_webdns_command_table): Add WEBDNS_RENAMEVS. (mod_webdns_transaction): Add CMD_WEBDNS_RENAMEVS. * mod_webdns.h (CMD_WEBDNS_RENAMEVS): New macro. * mod_webdns_lib.c (mod_webdns_command_lib): Add webdns_renamevs. (mod_webdns_do_cmd): Reformat CMD_WEBDNS_NAMEDGEN. Add CMD_WEBDNS_RENAMEVS. * webdns.h (domain_renamevs): Declare. Fri Mar 10 13:09:49 2000 Nick Burrett * domain.c (add_record): Take `domain' as an additional parameter. Ensure origin of a new resource record is within domain. (delete_record): Take `domain' as an additional parameter. (domain_modify): Pass domain as an argument to add_record and delete_record. Thu Mar 9 14:32:57 2000 Nick Burrett * mod_webdns_lib.c (mod_webdns_command_lib): Add webdns_namedgen. (mod_webdns_do_cmd): Add CMD_WEBDNS_NAMEDGEN. Mon Mar 6 10:48:31 2000 Nick Burrett * domain.c (param, check_domain_name): Moved earlier in source. (check_ip_address): Likewise. (check_domain_name): Additional check to ensure at least one character is part of the standard alphabet. (check_origin): New function. (domain_add_primary): Check the domain name is valid. (domain_add_secondary): Likewise. (add_record): Use check_origin to validate the origin argument. (delete_record): Likewise. (webdns_root_named_gen): New function. (domain_deletevs): New function. * mod_webdns.c (mod_webdns_command_tag): Add WEBDNS_DELETEVS, WEBDNS_ROOTNAMEDGEN. (mod_webdns_transaction): Add case statements for the above commands. * mod_webdns_lib.c (mod_webdns_command_lib): Add webdns_deletevs. (mod_webdns_do_cmd): Add CMD_WEBDNS_DELETEVS. * mod_webdns.h (CMD_WEBDNS_ROOTNAMEDGEN): Define. (CMD_WEBDNS_NAMEDGEN): Define. * parse.y (yylex): Handle wildcard domains. * webdns.h (webdns_root_named_gen): Declare. Thu Jan 13 14:33:31 2000 Nick Burrett * domain.c (domain_delete): Check domain databases only if they exist. Thu Jan 13 14:20:18 2000 Nick Burrett * domain.c (list_domains): Add a newline in between each domain. (domain_get): Add a newline between each RR. (pri_named_conf): Delete function. Delete all callers. (sec_named_conf): Delete function. Delete all callers. (webdns_named_gen): New function. (domain_add_primary): Check domain databases only if they exist. (domain_add_secondary): Likewise. * mod_webdns.c (mod_webdns_command_table): Add WEBDNS_NAMEDGEN. (mod_webdns_transaction): Add case WEBDNS_NAMEDGEN. * mod_webdns.h (WEBDNS_NAMEDGEN): Define. * webdns.h (webdns_named_gen): Declare. Tue Dec 21 16:30:36 1999 Nick Burrett Manage two databases to prevent users manipulating certain domains and adding domains that already exist on the system. * dbase.c: New file. * webdns.h: Add declarations for functions in the above file. * mod_webdns.c (mod_webdns_command_table): Add WEBDNS_DBGEN, WEBDNS_DBLIST, WEBDNS_DBADD, WEBDNS_DBDELETE. (mod_webdns_transaction): Likewise. * mod_webdns.h (CMD_WEBDNS_DBGEN): New macro. (WEBDNS_DBLIST, WEBDNS_DBADD, WEBDNS_DBDELETE): New macros. * mod_webdns_lib.c (mod_webdns_command_list): Add WEBDNS_DBGEN, WEBDNS_DBLIST, WEBDNS_DBADD, WEBDNS_DBDELETE. (mod_webdns_do_cmd): Add handlers for the new commands. * Makefile.in (OBJS): Add dbase.o. * domain.c (domain_add_primary): Check databases to verify that user is allowed to alter the domain. (domain_delete): Likewise. (domain_add_secondary): Likewise. (domain_modify): Likewise. * domain.c (domain_add_primary): Reduce expiry time on SOA record from 41 days to 1 week.