[freeside-commits] freeside/FS/FS Conf.pm, 1.141,
1.142 domain_record.pm, 1.20, 1.21
Ivan,,,
ivan at wavetail.420.am
Sun Oct 16 07:04:02 PDT 2005
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv428/FS/FS
Modified Files:
Conf.pm domain_record.pm
Log Message:
add zone-underscore config file, update bind.import to use command-line options instead of ask for input
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- Conf.pm 15 Oct 2005 13:40:30 -0000 1.141
+++ Conf.pm 16 Oct 2005 14:04:00 -0000 1.142
@@ -1617,6 +1617,12 @@
'type' => 'checkbox',
},
+ {
+ 'key' => 'zone-underscore',
+ 'section' => 'BIND',
+ 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
+ 'type' => 'checkbox',
+ },
);
Index: domain_record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/domain_record.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- domain_record.pm 3 May 2005 08:46:57 -0000 1.20
+++ domain_record.pm 16 Oct 2005 14:04:00 -0000 1.21
@@ -250,9 +250,17 @@
return "Unknown svcnum (in svc_domain)"
unless qsearchs('svc_domain', { 'svcnum' => $self->svcnum } );
- $self->reczone =~ /^(@|[a-z0-9\.\-\*]+)$/i
- or return "Illegal reczone: ". $self->reczone;
- $self->reczone($1);
+ my $conf = new FS::Conf;
+
+ if ( $conf->exists('zone-underscore') ) {
+ $self->reczone =~ /^(@|[a-z0-9_\.\-\*]+)$/i
+ or return "Illegal reczone: ". $self->reczone;
+ $self->reczone($1);
+ } else {
+ $self->reczone =~ /^(@|[a-z0-9\.\-\*]+)$/i
+ or return "Illegal reczone: ". $self->reczone;
+ $self->reczone($1);
+ }
$self->recaf =~ /^(IN)$/ or return "Illegal recaf: ". $self->recaf;
$self->recaf($1);
@@ -284,17 +292,26 @@
or return "Illegal data for A record: ". $self->recdata;
$self->recdata($1);
} elsif ( $self->rectype eq 'PTR' ) {
- $self->recdata =~ /^([a-z0-9\.\-]+)$/i
- or return "Illegal data for PTR record: ". $self->recdata;
- $self->recdata($1);
+ if ( $conf->exists('zone-underscore') ) {
+ $self->recdata =~ /^([a-z0-9_\.\-]+)$/i
+ or return "Illegal data for PTR record: ". $self->recdata;
+ $self->recdata($1);
+ } else {
+ $self->recdata =~ /^([a-z0-9\.\-]+)$/i
+ or return "Illegal data for PTR record: ". $self->recdata;
+ $self->recdata($1);
+ }
} elsif ( $self->rectype eq 'CNAME' ) {
$self->recdata =~ /^([a-z0-9\.\-]+|\@)$/i
or return "Illegal data for CNAME record: ". $self->recdata;
$self->recdata($1);
} elsif ( $self->rectype eq 'TXT' ) {
- $self->recdata =~ /^((?:\S+)|(?:".+"))$/
- or return "Illegal data for TXT record: ". $self->recdata;
- $self->recdata($1);
+ if ( $self->recdata =~ /^((?:\S+)|(?:".+"))$/ ) {
+ $self->recdata($1);
+ } else {
+ $self->recdata('"'. $self->recdata. '"'); #?
+ }
+ # or return "Illegal data for TXT record: ". $self->recdata;
} elsif ( $self->rectype eq '_mstr' ) {
$self->recdata =~ /^((\d{1,3}\.){3}\d{1,3})$/
or return "Illegal data for _master pseudo-record: ". $self->recdata;
More information about the freeside-commits
mailing list