metasploit_data_models 0.22.1-java → 0.22.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad658aa19508e799c82bf3ebd6fb07e31faa89ac
4
- data.tar.gz: 3b2b424d52229202fbada93525a4e51c24a909ef
3
+ metadata.gz: 703619595ed4157d465b8c3452d7a2448c0a7aeb
4
+ data.tar.gz: 84e23d000a56b7c15569bdc6140475672fd466e5
5
5
  SHA512:
6
- metadata.gz: 21888e5aaae09007d205ca7c872ab6d119b5bb17f07ca40e464daa589de1478ed73d74fd7a6c2d92049520204ea33f1786acbb6c0d394fe5d0f793cc9efe88c7
7
- data.tar.gz: b996c42af0964622b11726314feec9ca39a0641723a19f7e097f02b0ad5c4ee72e998dc7cab4c79eab9d74561d4cb8c7cee619cfa6e91327ff4f02714c7ab891
6
+ metadata.gz: 84019d5b0aa840b29ab44b93338531435fc2a13829264f3468f10866342eca6e6e6e994933173cf51a2fd97f6e021b59bc56cd319bf5edae75ddfb95ae19a7ca
7
+ data.tar.gz: a6a430993271b3187cb61221e255e5cc407b5d10d69fe0b6b658c1494268fe13a5f291d23fde94af23dddb87ebea7f8eeec982e928ff44f02d8bec1b954d7296
@@ -222,14 +222,19 @@ class Mdm::Service < ActiveRecord::Base
222
222
  in: PROTOS
223
223
  }
224
224
 
225
- validates :host_id,
226
- uniqueness: {
227
- message: 'already has a service with this port and proto',
228
- scope: [
229
- :port,
230
- :proto
231
- ]
232
- }
225
+ validate :uniq_port_proto_per_host
226
+
227
+ # Custom validation to ensure that the combination of port and protocol
228
+ # for a service doesn't already exist for the same host.
229
+ def uniq_port_proto_per_host
230
+ no_dupes = Mdm::Service.where(host_id: host.id, port: port, proto: proto).blank?
231
+ error_msg = 'This host already has a service with this port and protocol.'
232
+
233
+ unless no_dupes
234
+ errors.add(:port, error_msg)
235
+ errors.add(:proto, error_msg)
236
+ end
237
+ end
233
238
 
234
239
  #
235
240
  # Class Methods
@@ -6,7 +6,7 @@ module MetasploitDataModels
6
6
  # The minor version number, scoped to the {MAJOR} version number.
7
7
  MINOR = 22
8
8
  # The patch number, scoped to the {MINOR} version number.
9
- PATCH = 1
9
+ PATCH = 2
10
10
 
11
11
  # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the `PRERELEASE` in the
12
12
  # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.1
4
+ version: 0.22.2
5
5
  platform: java
6
6
  authors:
7
7
  - Samuel Huckins
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-01-16 00:00:00.000000000 Z
14
+ date: 2015-01-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake