bind9mgr 0.3.16 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -101,3 +101,7 @@
101
101
  === 0.3.16 / 2013-03-06
102
102
 
103
103
  * less debug messages in stdout
104
+
105
+ === 0.3.17 / 2013-03-06
106
+
107
+ * owner can contain digits only (for reverse DNS PTR records)
data/lib/bind9mgr.rb CHANGED
@@ -6,7 +6,7 @@ require File.join( File.dirname(__FILE__), 'resource_record' )
6
6
  require File.join( File.dirname(__FILE__), 'parser' )
7
7
 
8
8
  module Bind9mgr
9
- VERSION = '0.3.16'
9
+ VERSION = '0.3.17'
10
10
 
11
11
  ZONES_BIND_SUBDIR = 'primary'
12
12
 
@@ -17,8 +17,8 @@ module Bind9mgr
17
17
  def valid?
18
18
  @errors = []
19
19
  (@errors << "Base type_and_rdata_shouldnt_be_blank"; return false) unless @type && @rdata
20
- (@errors << "Rdata rdata_shouldnt_be_blank_string"; return false) if @rdata.kind_of?(String) && @rdata.length < 1
21
- (@errors << "Owner invalid") if @owner && ( !@owner.kind_of?(String) || (@owner.match(/^\d+$/)) || (@owner == 'localhost') )
20
+ (@errors << "Rdata rdata_shouldnt_be_blank_string"; return false) if @rdata.kind_of?(String) && (@rdata.length < 1 || !@rdata.match(/[^\.\;\,]/))
21
+ (@errors << "Owner invalid") if @owner && ( !@owner.kind_of?(String) || (@owner == 'localhost') )
22
22
  (@errors << "Class invalid") if !klass.nil? && !KLASSES.include?( klass )
23
23
  (@errors << "Type not_supported") unless ALLOWED_TYPES.include?( type )
24
24
 
@@ -56,13 +56,13 @@ describe Bind9mgr::ResourceRecord do
56
56
  it( "with nil owner" ) { subject.new( nil, nil, 'IN', 'A', '192.168.1.1' ).should be_valid }
57
57
 
58
58
  it( "with '1' in all fields" ) { subject.new( '1', '1', '1', 'A', '1' ).should_not be_valid }
59
- it( "with digit in owner" ) { subject.new( '1', nil, 'IN', 'A', '192.168.1.1' ).should_not be_valid }
60
- it( "with double digit in owner" ) { subject.new( '11', nil, 'IN', 'A', '192.168.1.1' ).should_not be_valid }
59
+ # bind ignores this, so we are # it( "with digit in owner" ) { subject.new( '1', nil, 'IN', 'A', '192.168.1.1' ).should_not be_valid }
60
+ # bind ignores this, so we are # it( "with double digit in owner" ) { subject.new( '11', nil, 'IN', 'A', '192.168.1.1' ).should_not be_valid }
61
61
  it( "with blank rdata" ) { subject.new( 'sub', nil, 'IN', 'A', '' ).should_not be_valid }
62
62
  it( "with nil rdata" ) { subject.new( 'sub', nil, 'IN', 'A', nil ).should_not be_valid }
63
- it( "with digit in rdata" ) { subject.new( '1', nil, 'IN', 'A', '1' ).should_not be_valid }
64
- it( "with char in rdata" ) { subject.new( '1', nil, 'IN', 'A', 's' ).should_not be_valid }
65
- it( "with punctuation in rdata" ) { subject.new( '1', nil, 'IN', 'A', ',;;;' ).should_not be_valid }
63
+ # it( "with digit in rdata" ) { subject.new( 'qwe', nil, 'IN', 'A', '1' ).should_not be_valid }
64
+ # it( "with char in rdata" ) { subject.new( 'qwe', nil, 'IN', 'A', 's' ).should_not be_valid }
65
+ it( "with punctuation in rdata" ) { subject.new( 'qwe', nil, 'IN', 'A', ',;;;' ).should_not be_valid }
66
66
  it( "with wrong class" ) { subject.new( 'sub', nil, 'IN222', 'A', '192.168.1.1' ).should_not be_valid }
67
67
  end
68
68
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bind9mgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.16
4
+ version: 0.3.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: