[vhffs-dev] [1310] Allow wildcard RR, the vhffs_dns_rr. data field was not long enough for TXT (like SPF)

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1310
Author:   gradator
Date:     2008-11-07 13:25:36 +0100 (Fri, 07 Nov 2008)

Log Message:
-----------
Allow wildcard RR, the vhffs_dns_rr.data field was not long enough for TXT (like SPF)

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Services/DNS.pm
    trunk/vhffs-backend/src/pgsql/initdb.sql.in
    trunk/vhffs-compat/4.1.sql


Modified: trunk/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2008-11-02 01:07:10 UTC (rev 1309)
+++ trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2008-11-07 12:25:36 UTC (rev 1310)
@@ -459,7 +459,7 @@
 
 sub check_rr_name {
 	my $name = shift;
-	return ($name =~ /^(?:(?:[a-z0-9\-]{1,63}(?:\.[a-z0-9\-]{1,63})*)|@)$/ );
+	return ($name =~ /^(?:(?:[a-z0-9\-\_\*]{1,63}(?:\.[a-z0-9\-\_]{1,63})*)|@)$/ );
 }
 
 

Modified: trunk/vhffs-backend/src/pgsql/initdb.sql.in
===================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql.in	2008-11-02 01:07:10 UTC (rev 1309)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in	2008-11-07 12:25:36 UTC (rev 1310)
@@ -202,7 +202,7 @@
 -- it can vary followin the type attribute.
 	name varchar(64) NOT NULL,
 	type VARCHAR(5) NOT NULL,
-	data varchar(128) NOT NULL,
+	data varchar(512) NOT NULL,
 	aux INTEGER NOT NULL DEFAULT 0,
 	ttl INTEGER NOT NULL DEFAULT 86400,
 	CONSTRAINT vhffs_dns_rr_pkey PRIMARY KEY (id)

Modified: trunk/vhffs-compat/4.1.sql
===================================================================
--- trunk/vhffs-compat/4.1.sql	2008-11-02 01:07:10 UTC (rev 1309)
+++ trunk/vhffs-compat/4.1.sql	2008-11-07 12:25:36 UTC (rev 1310)
@@ -1,6 +1,6 @@
 ALTER TABLE vhffs_pgsql ADD COLUMN dbencoding VARCHAR(20) NOT NULL DEFAULT 'LATIN1';
 
--- 16 bytes is not enough
+-- 16 bytes is not enough for vhffs_pgsql.dbuser
 BEGIN;
 ALTER TABLE vhffs_pgsql ADD COLUMN dbuser_new varchar(200);
 UPDATE vhffs_pgsql SET dbuser_new = dbuser;
@@ -37,3 +37,12 @@
 ALTER TABLE vhffs_cron ADD CONSTRAINT vhffs_cron_unique_cronpath UNIQUE (cronpath);
 CREATE INDEX idx_vhffs_cron_nextrun ON vhffs_cron(nextrundate);
 ALTER TABLE vhffs_cron ADD CONSTRAINT fk_vhffs_vhffs_cron_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+
+-- 128 bytes is not enough for vhffs_dns_rr.data, TXT fields might be bigger
+BEGIN;
+ALTER TABLE vhffs_dns_rr ADD COLUMN data_new varchar(512);
+UPDATE vhffs_dns_rr SET data_new = data;
+ALTER TABLE vhffs_dns_rr DROP COLUMN data; 
+ALTER TABLE vhffs_dns_rr RENAME COLUMN data_new TO data;
+ALTER TABLE vhffs_dns_rr ALTER COLUMN data SET NOT NULL;
+COMMIT;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/