git-ds 0.9.6 → 0.9.6.1

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.
Files changed (3) hide show
  1. data/ChangeLog +4 -0
  2. data/lib/git-ds/model/item.rb +7 -0
  3. metadata +28 -51
data/ChangeLog CHANGED
@@ -1,4 +1,8 @@
1
+ 2011-06-06 : mkfs <mkfs@thoughtgang.org>
2
+ * Added runtime checks (and exceptions) for NULL bytes in path
3
+
1
4
  2011-05-20 : mkfs <mkfs@thoughtgang.org>
5
+ * Bumped gem version to 0.9.6
2
6
  * Fixed default-commmit bug in Database and Repo classes.
3
7
 
4
8
  2011-04-19 : mkfs <mkfs@thoughtgang.org>
@@ -19,6 +19,9 @@ require 'git-ds/model/property'
19
19
 
20
20
  module GitDS
21
21
 
22
+ class InvalidModelItemPath < RuntimeError
23
+ end
24
+
22
25
  class InvalidModelItemError < RuntimeError
23
26
  end
24
27
 
@@ -180,6 +183,7 @@ Note that this returns the ident of the created item, not an instance.
180
183
  def create_in_path(model, parent_path, args)
181
184
  id = ident(args)
182
185
  item_path = build_path(parent_path) + ::File::SEPARATOR + id
186
+ raise InvalidModelItemPath if (not item_path) || item_path =~ /\000/
183
187
 
184
188
  # Ensure that nested calls (e.g. to create children) share index#write
185
189
  cls = self
@@ -306,6 +310,9 @@ The GitDS::Model that contains the object.
306
310
  attr_reader :model
307
311
 
308
312
  def initialize_item(model, path)
313
+ # NULLS in Path objects cause corrupt trees!
314
+ raise InvalidModelItemPath if (not path) || path =~ /\000/
315
+
309
316
  @model = model
310
317
  @path = path
311
318
  @ident = File.basename(path)
metadata CHANGED
@@ -1,46 +1,33 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: git-ds
3
- version: !ruby/object:Gem::Version
4
- hash: 55
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.6.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 9
9
- - 6
10
- version: 0.9.6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - TG Community
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-05-20 00:00:00 -04:00
12
+ date: 2011-06-06 00:00:00.000000000 -04:00
19
13
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: grit
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &14078760 !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 2
32
- - 2
33
- - 0
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
34
22
  version: 2.2.0
35
23
  type: :runtime
36
- version_requirements: *id001
24
+ prerelease: false
25
+ version_requirements: *14078760
37
26
  description: A hierarchical datastore based on Git.
38
27
  email: community@thoughtgang.org
39
28
  executables: []
40
-
41
29
  extensions: []
42
-
43
- extra_rdoc_files:
30
+ extra_rdoc_files:
44
31
  - doc/Examples.rdoc
45
32
  - doc/examples/key_value/kv_get.rb
46
33
  - doc/examples/key_value/kv_list.rb
@@ -69,7 +56,7 @@ extra_rdoc_files:
69
56
  - doc/examples/test_suite/ts_add_bug.rb
70
57
  - doc/examples/test_suite/ts_add_module_to_test.rb
71
58
  - README.rdoc
72
- files:
59
+ files:
73
60
  - lib/git-ds.rb
74
61
  - lib/git-ds/model.rb
75
62
  - lib/git-ds/exec_cmd.rb
@@ -125,41 +112,31 @@ files:
125
112
  - README.rdoc
126
113
  has_rdoc: true
127
114
  homepage: http://www.thoughtgang.org
128
- licenses:
115
+ licenses:
129
116
  - GPLv3
130
117
  post_install_message:
131
118
  rdoc_options: []
132
-
133
- require_paths:
119
+ require_paths:
134
120
  - lib
135
- required_ruby_version: !ruby/object:Gem::Requirement
121
+ required_ruby_version: !ruby/object:Gem::Requirement
136
122
  none: false
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- hash: 57
141
- segments:
142
- - 1
143
- - 8
144
- - 7
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
145
126
  version: 1.8.7
146
- required_rubygems_version: !ruby/object:Gem::Requirement
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
128
  none: false
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- hash: 3
152
- segments:
153
- - 0
154
- version: "0"
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
155
133
  requirements: []
156
-
157
134
  rubyforge_project: git-db
158
- rubygems_version: 1.4.1
135
+ rubygems_version: 1.6.2
159
136
  signing_key:
160
137
  specification_version: 3
161
138
  summary: Git-DS
162
- test_files:
139
+ test_files:
163
140
  - tests/ut_git_grit_equiv.rb
164
141
  - tests/ut_user_group_model.rb
165
142
  - tests/ut_model.rb