win32-security 0.1.4 → 0.2.0
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.
- data/CHANGES +4 -0
- data/MANIFEST +8 -8
- data/README +1 -1
- data/Rakefile +9 -5
- data/lib/win32/security.rb +76 -33
- data/lib/win32/security/acl.rb +32 -31
- data/lib/win32/security/sid.rb +97 -118
- data/lib/win32/security/windows/constants.rb +121 -0
- data/lib/win32/security/windows/functions.rb +97 -0
- data/lib/win32/security/windows/structs.rb +67 -0
- data/test/test_acl.rb +82 -57
- data/test/test_security.rb +9 -24
- data/test/test_sid.rb +5 -9
- data/win32-security.gemspec +4 -4
- metadata +11 -8
data/test/test_sid.rb
CHANGED
@@ -4,15 +4,15 @@
|
|
4
4
|
# Test suite for the Win32::Security::SID class. You should run these
|
5
5
|
# tests via the 'rake test' task.
|
6
6
|
########################################################################
|
7
|
+
require 'etc'
|
7
8
|
require 'test-unit'
|
8
9
|
require 'win32/security'
|
9
|
-
require 'sys/admin'
|
10
10
|
include Win32
|
11
11
|
|
12
12
|
class TC_Win32_Security_Sid < Test::Unit::TestCase
|
13
13
|
def self.startup
|
14
14
|
@@host = Socket.gethostname
|
15
|
-
@@name =
|
15
|
+
@@name = Etc.getlogin
|
16
16
|
end
|
17
17
|
|
18
18
|
def setup
|
@@ -20,7 +20,7 @@ class TC_Win32_Security_Sid < Test::Unit::TestCase
|
|
20
20
|
end
|
21
21
|
|
22
22
|
test "version is set to expected value" do
|
23
|
-
assert_equal('0.
|
23
|
+
assert_equal('0.2.0', Security::SID::VERSION)
|
24
24
|
end
|
25
25
|
|
26
26
|
test "sid method basic functionality" do
|
@@ -59,10 +59,6 @@ class TC_Win32_Security_Sid < Test::Unit::TestCase
|
|
59
59
|
assert_kind_of(String, Security::SID.string_to_sid(@sid.to_s))
|
60
60
|
end
|
61
61
|
|
62
|
-
test "string/sid roundtrip works as expected" do
|
63
|
-
assert_true(Security::SID.new(Security::SID.string_to_sid('S-1-5-18')).to_s == 'S-1-5-18')
|
64
|
-
end
|
65
|
-
|
66
62
|
test "to_s works as expected" do
|
67
63
|
assert_respond_to(@sid, :to_s)
|
68
64
|
assert_kind_of(String, @sid.to_s)
|
@@ -101,7 +97,7 @@ class TC_Win32_Security_Sid < Test::Unit::TestCase
|
|
101
97
|
|
102
98
|
test "constructor defaults to current account" do
|
103
99
|
assert_nothing_raised{ @sid = Security::SID.new }
|
104
|
-
assert_equal(
|
100
|
+
assert_equal(Etc.getlogin, @sid.account)
|
105
101
|
end
|
106
102
|
|
107
103
|
test "constructor accepts an account argument" do
|
@@ -117,7 +113,7 @@ class TC_Win32_Security_Sid < Test::Unit::TestCase
|
|
117
113
|
end
|
118
114
|
|
119
115
|
test "constructor raises an error if an invalid account is passed" do
|
120
|
-
assert_raise(
|
116
|
+
assert_raise(SystemCallError){ Security::SID.new('bogus') }
|
121
117
|
end
|
122
118
|
|
123
119
|
test "well known sid constants are defined" do
|
data/win32-security.gemspec
CHANGED
@@ -2,11 +2,11 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'win32-security'
|
5
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.2.0'
|
6
6
|
spec.authors = ['Daniel J. Berger', 'Park Heesob']
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
9
|
-
spec.homepage = '
|
9
|
+
spec.homepage = 'https://github.com/djberg96/win32-security'
|
10
10
|
spec.summary = 'A library for dealing with aspects of Windows security.'
|
11
11
|
spec.test_files = Dir['test/*.rb']
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
@@ -14,10 +14,10 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
15
15
|
spec.rubyforge_project = 'win32utils'
|
16
16
|
|
17
|
-
spec.add_dependency('
|
17
|
+
spec.add_dependency('ffi')
|
18
18
|
|
19
19
|
spec.add_development_dependency('test-unit', '>= 2.5.0')
|
20
|
-
spec.add_development_dependency('sys-admin', '>= 1.
|
20
|
+
spec.add_development_dependency('sys-admin', '>= 1.6.0')
|
21
21
|
|
22
22
|
spec.description = <<-EOF
|
23
23
|
The win32-security library provides an interface for dealing with
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-security
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,16 +10,16 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-01-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: ffi
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ! '>='
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
30
|
+
version: '0'
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: test-unit
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.6.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ! '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.
|
62
|
+
version: 1.6.0
|
63
63
|
description: ! " The win32-security library provides an interface for dealing with\n
|
64
64
|
\ security related aspects of MS Windows. At the moment it provides an\n interface
|
65
65
|
for inspecting or creating SID's.\n"
|
@@ -75,6 +75,9 @@ files:
|
|
75
75
|
- lib/win32/security/ace.rb
|
76
76
|
- lib/win32/security/acl.rb
|
77
77
|
- lib/win32/security/sid.rb
|
78
|
+
- lib/win32/security/windows/constants.rb
|
79
|
+
- lib/win32/security/windows/functions.rb
|
80
|
+
- lib/win32/security/windows/structs.rb
|
78
81
|
- lib/win32/security.rb
|
79
82
|
- MANIFEST
|
80
83
|
- Rakefile
|
@@ -83,7 +86,7 @@ files:
|
|
83
86
|
- test/test_security.rb
|
84
87
|
- test/test_sid.rb
|
85
88
|
- win32-security.gemspec
|
86
|
-
homepage:
|
89
|
+
homepage: https://github.com/djberg96/win32-security
|
87
90
|
licenses:
|
88
91
|
- Artistic 2.0
|
89
92
|
post_install_message:
|