containerize_me 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ require base + '/cp_dep_libs'
11
11
  ENV['PATH'] += "/opt/cyberconnect/bin:/opt/cyberconnect/usr/bin:/opt/cyberconnect/sbin:/opt/cyberconnect/usr/sbin"
12
12
 
13
13
  class ContainerizeMe
14
- VERSION = '0.1.1'
14
+ VERSION = '0.1.2'
15
15
  end
16
16
  class JailKitNotFoundError < StandardError ; end
17
17
  class JailNotWritable < StandardError ; end
@@ -189,12 +189,25 @@ module Jail
189
189
  cfg[:users].each { |user| Jail.add_user(user) } if cfg[:users].kind_of?(Array)
190
190
  end
191
191
 
192
+ if cfg.has_key?(:add_non_system_users)
193
+ if cfg[:add_non_system_users].kind_of?(Array)
194
+ cfg[:add_non_system_users].each { |user|
195
+ add_user_not_in_root_system(user)
196
+ user_home = "#{@config.jail}/home/#{user}"
197
+ FileUtils.mkdir_p(user_home) unless File.directory?(user_home)
198
+ `chroot #{@config.jail} chown #{user} #{user_home}`
199
+ }
200
+ end
201
+ end
202
+
192
203
  if cfg.has_key?(:mkdir)
193
204
  if cfg[:mkdir].kind_of?(Array)
194
205
  cfg[:mkdir].each { |dir|
195
206
  d = "#{@config.jail}#{dir[:item]}"
196
207
  FileUtils.mkdir_p d unless File.directory?(d)
197
208
  if dir[:user].length > 0 && dir[:group].length > 0
209
+ # in case the user exists in the jail but not system
210
+ #`chroot #{@config.jail} chown #{dir[:user]}:#{dir[:group]} #{dir[:item]}`
198
211
  FileUtils.chown(dir[:user], dir[:group], d)
199
212
  FileUtils.chmod(dir[:mode], d) if dir.has_key?(:mode)
200
213
  end
@@ -237,16 +250,6 @@ module Jail
237
250
  }
238
251
  end
239
252
  end
240
-
241
- if cfg.has_key?(:add_non_system_users)
242
- if cfg[:add_non_system_users].kind_of?(Array)
243
- cfg[:add_non_system_users].each { |user|
244
- add_user_not_in_root_system(user)
245
- }
246
- end
247
- end
248
-
249
-
250
253
  end
251
254
 
252
255
  def perform
@@ -9,6 +9,7 @@
9
9
  - /bin/uname
10
10
  - /usr/bin/env
11
11
  - /bin/sh
12
+ - /bin/chown
12
13
  - /usr/bin/which
13
14
  - /bin/bash
14
15
  - /usr/bin/nohup
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: containerize_me
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cliff Cyphers
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-23 00:00:00 Z
13
+ date: 2011-08-30 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: platform_helpers
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements: []
90
90
 
91
91
  rubyforge_project: containerize_me
92
- rubygems_version: 1.8.8
92
+ rubygems_version: 1.8.10
93
93
  signing_key:
94
94
  specification_version: 3
95
95
  summary: Containerize Me is intended to provide a cross distro linux means for easily defining charactieristics of a chroot jail in yaml format