From 24f7e5b6cd7bfe9e81a40a3e40de84685a2f7968 Mon Sep 17 00:00:00 2001 From: soh_cah_toa Date: Thu, 16 May 2013 23:14:29 -0400 Subject: [PATCH] Separated 'pattern' and 'type' properties in DNS model. This will expose the resource type to the RESTful API (coming soon). --- extensions/dns/model.rb | 7 ++++--- extensions/dns/ruby/rubydns.rb | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/dns/model.rb b/extensions/dns/model.rb index 2a03f2fc8..84ac3555a 100644 --- a/extensions/dns/model.rb +++ b/extensions/dns/model.rb @@ -14,9 +14,10 @@ module DNS storage_names[:default] = 'extension_dns_rules' - property :id, Serial - property :pattern, Object - property :block, Text + property :id, Serial # Unique identifier + property :pattern, Object # Query pattern + property :type, Object # Resource type + property :block, Text # Associated callback end diff --git a/extensions/dns/ruby/rubydns.rb b/extensions/dns/ruby/rubydns.rb index 3dbc837e8..fb5e21c62 100644 --- a/extensions/dns/ruby/rubydns.rb +++ b/extensions/dns/ruby/rubydns.rb @@ -55,7 +55,8 @@ module RubyDNS # Add new rule to database BeEF::Core::Models::DNS::Rule.create( :id => id, - :pattern => pattern, + :pattern => pattern[0], + :type => pattern[1], :block => block.to_source ) end