secure 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ module Secure
25
25
  Process::setrlimit(Process::RLIMIT_AS, @limit_memory) if @limit_memory
26
26
  Process::setrlimit(Process::RLIMIT_CPU, @limit_cpu, 2 + @limit_cpu) if @limit_cpu
27
27
  Process::setrlimit(Process::RLIMIT_NOFILE, @limit_files, @limit_files) if @limit_files
28
- Process::setrlimit(Process::RLIMIT_NPROC, @limit_procs, @limit_procs) if @limit_procs
28
+ #Process::setrlimit(Process::RLIMIT_NPROC, @limit_procs, @limit_procs) if @limit_procs
29
29
  end
30
30
 
31
31
  def redirect_files
@@ -1,3 +1,3 @@
1
1
  module Secure
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -133,7 +133,6 @@ module Secure
133
133
  response.error.should be_a(Errno::EMFILE)
134
134
  end
135
135
 
136
-
137
136
  it "should not be able to open a file" do
138
137
  response = Runner.new.run do
139
138
  File.open("/etc/passwd")
@@ -141,6 +140,12 @@ module Secure
141
140
  response.should_not be_success
142
141
  response.error.should be_a(SecurityError)
143
142
  end
143
+
144
+ it "should not kill safe code due to limits" do
145
+ response = Runner.new(:limit_files => 0, :limit_procs => 0).run { 10 }
146
+ response.should be_success
147
+ response.value.should == 10
148
+ end
144
149
  end
145
150
 
146
151
  context "allowed syntax" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secure
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-26 00:00:00.000000000Z
12
+ date: 2011-10-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70151114884720 !ruby/object:Gem::Requirement
16
+ requirement: &70115111977220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70151114884720
24
+ version_requirements: *70115111977220
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70151114884300 !ruby/object:Gem::Requirement
27
+ requirement: &70115111976800 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70151114884300
35
+ version_requirements: *70115111976800
36
36
  description: see summary
37
37
  email:
38
38
  - tejas@gja.in