win32-security 0.3.2 → 0.3.3
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +6 -0
- data/README +3 -3
- data/appveyor.yml +46 -0
- data/lib/win32/security.rb +1 -1
- data/lib/win32/security/sid.rb +4 -8
- data/test/test_security.rb +1 -1
- data/test/test_sid.rb +8 -2
- data/win32-security.gemspec +3 -1
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f0cdfb7c3954a89c3d2e4320f2c27fcd2311be6
|
4
|
+
data.tar.gz: 30b2df084b416d6822b3c975ad72d85f9e2d687a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 785d0356537d86bd64e486bf5981c1a1c22fe3abb85e0c43357bd9cdb43a642b7cdca141e6de33a6cd878d3b5349a6626523a82cc5985fdd1093f8e38b4c677f
|
7
|
+
data.tar.gz: bb52c0719a509d74f3372ae7f929a25e89eca96cacfa3be0f5da5c9c4b64979733b1d45685c41db6dd27fe516e3a0b560d8954a08f764b0de2e36eb76160a801
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 0.3.3 - 1-Mar-2016
|
2
|
+
* Fixed a potential bug in the Win32::Security::SID constructor. Thanks go
|
3
|
+
to nmeilick for the spot and patch.
|
4
|
+
* This gem now requires Ruby 1.9.3 or later.
|
5
|
+
* Added some SID tests.
|
6
|
+
|
1
7
|
== 0.3.2 - 4-Dec-2015
|
2
8
|
* This gem is now signed.
|
3
9
|
* Added a win32-security.rb file for convenience.
|
data/README
CHANGED
@@ -37,15 +37,15 @@
|
|
37
37
|
|
38
38
|
== Contributions
|
39
39
|
Although this library is free, please consider having your company
|
40
|
-
setup a
|
40
|
+
setup a tip if used by your company professionally.
|
41
41
|
|
42
|
-
|
42
|
+
https://gratipay.com/~djberg96/
|
43
43
|
|
44
44
|
== License
|
45
45
|
Artistic 2.0
|
46
46
|
|
47
47
|
== Copyright
|
48
|
-
(C) 2003-
|
48
|
+
(C) 2003-2016 Daniel J. Berger
|
49
49
|
All Rights Reserved
|
50
50
|
|
51
51
|
== Authors
|
data/appveyor.yml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
branches:
|
3
|
+
only:
|
4
|
+
- ffi
|
5
|
+
skip_tags: true
|
6
|
+
clone_depth: 10
|
7
|
+
environment:
|
8
|
+
matrix:
|
9
|
+
- ruby_version: 193
|
10
|
+
ruby_dir: 1.9.1
|
11
|
+
- ruby_version: 200
|
12
|
+
ruby_dir: 2.0.0
|
13
|
+
- ruby_version: 200-x64
|
14
|
+
ruby_dir: 2.0.0
|
15
|
+
- ruby_version: 21
|
16
|
+
ruby_dir: 2.1.0
|
17
|
+
- ruby_version: 21-x64
|
18
|
+
ruby_dir: 2.1.0
|
19
|
+
- ruby_version: 22
|
20
|
+
ruby_dir: 2.2.0
|
21
|
+
- ruby_version: 22-x64
|
22
|
+
ruby_dir: 2.2.0
|
23
|
+
install:
|
24
|
+
- ps: >-
|
25
|
+
$env:path = "C:\Ruby" + $env:ruby_version + "\bin;" + $env:path
|
26
|
+
|
27
|
+
$tpath = "C:\Ruby" + $env:ruby_version + "\lib\ruby\" + $env:ruby_dir + "\test"
|
28
|
+
|
29
|
+
if ((test-path $tpath) -eq $True){ rm -recurse -force $tpath }
|
30
|
+
|
31
|
+
gem update --system > $null
|
32
|
+
|
33
|
+
if ((gem query -i sys-admin) -eq $False){ gem install sys-admin --no-document }
|
34
|
+
|
35
|
+
if ((gem query -i test-unit -v ">= 3.0") -eq $False){ gem install test-unit --no-document }
|
36
|
+
cache:
|
37
|
+
- C:\Ruby193\lib\ruby\gems\1.9.1
|
38
|
+
- C:\Ruby200\lib\ruby\gems\2.0.0
|
39
|
+
- C:\Ruby200-x64\lib\ruby\gems\2.0.0
|
40
|
+
- C:\Ruby21\lib\ruby\gems\2.1.0
|
41
|
+
- C:\Ruby21-x64\lib\ruby\gems\2.1.0
|
42
|
+
- C:\Ruby22\lib\ruby\gems\2.2.0
|
43
|
+
- C:\Ruby22-x64\lib\ruby\gems\2.2.0
|
44
|
+
build: off
|
45
|
+
test_script:
|
46
|
+
- cmd: rake
|
data/lib/win32/security.rb
CHANGED
data/lib/win32/security/sid.rb
CHANGED
@@ -14,7 +14,7 @@ module Win32
|
|
14
14
|
extend Windows::Security::Functions
|
15
15
|
|
16
16
|
# The version of the Win32::Security::SID class.
|
17
|
-
VERSION = '0.2.
|
17
|
+
VERSION = '0.2.3'
|
18
18
|
|
19
19
|
# Some constant SID's for your convenience, in string format.
|
20
20
|
# See http://support.microsoft.com/kb/243330 for details.
|
@@ -225,12 +225,7 @@ module Win32
|
|
225
225
|
end
|
226
226
|
end
|
227
227
|
|
228
|
-
|
229
|
-
ordinal_val = account[0]
|
230
|
-
ordinal_val = ordinal_val.ord if RUBY_VERSION.to_f >= 1.9
|
231
|
-
else
|
232
|
-
ordinal_val = nil
|
233
|
-
end
|
228
|
+
ordinal_val = account ? account[0].ord : nil
|
234
229
|
|
235
230
|
sid = FFI::MemoryPointer.new(:uchar, 260)
|
236
231
|
sid_size = FFI::MemoryPointer.new(:ulong)
|
@@ -290,7 +285,8 @@ module Win32
|
|
290
285
|
|
291
286
|
# The arguments are flipped depending on which path we took
|
292
287
|
if ordinal_val.nil?
|
293
|
-
|
288
|
+
length = GetLengthSid(token_info)
|
289
|
+
@sid = token_info.read_string(length)
|
294
290
|
@account = sid.read_string(sid.size).strip
|
295
291
|
elsif ordinal_val < 10
|
296
292
|
@sid = account
|
data/test/test_security.rb
CHANGED
@@ -9,7 +9,7 @@ require 'win32/security'
|
|
9
9
|
|
10
10
|
class TC_Win32_Security < Test::Unit::TestCase
|
11
11
|
test "version constant is set to expected value" do
|
12
|
-
assert_equal('0.3.
|
12
|
+
assert_equal('0.3.3', Win32::Security::VERSION)
|
13
13
|
end
|
14
14
|
|
15
15
|
test "elevated security basic functionality" do
|
data/test/test_sid.rb
CHANGED
@@ -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.2.
|
23
|
+
assert_equal('0.2.3', Security::SID::VERSION)
|
24
24
|
end
|
25
25
|
|
26
26
|
test "sid method basic functionality" do
|
@@ -106,7 +106,13 @@ class TC_Win32_Security_Sid < Test::Unit::TestCase
|
|
106
106
|
end
|
107
107
|
|
108
108
|
test "constructor accepts an account argument" do
|
109
|
-
assert_nothing_raised{ Security::SID.new(@@name) }
|
109
|
+
assert_nothing_raised{ @sid = Security::SID.new(@@name) }
|
110
|
+
assert_equal(Etc.getlogin, @sid.account)
|
111
|
+
end
|
112
|
+
|
113
|
+
test "constructor accepts a sid argument" do
|
114
|
+
assert_nothing_raised{ @sid = Security::SID.new(@sid.sid) }
|
115
|
+
assert_equal(Etc.getlogin, @sid.account)
|
110
116
|
end
|
111
117
|
|
112
118
|
test "constructor accepts a host argument" do
|
data/win32-security.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'win32-security'
|
5
|
-
spec.version = '0.3.
|
5
|
+
spec.version = '0.3.3'
|
6
6
|
spec.authors = ['Daniel J. Berger', 'Park Heesob']
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -13,6 +13,8 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.cert_chain = Dir['certs/*']
|
14
14
|
|
15
15
|
spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
16
|
+
|
17
|
+
spec.required_ruby_version = '>= 1.9.3'
|
16
18
|
|
17
19
|
spec.add_dependency('ffi')
|
18
20
|
|
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
|
32
32
|
tGSHgAmcLlkdGgan182qsE/4kKM=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ffi
|
@@ -101,6 +101,7 @@ extra_rdoc_files:
|
|
101
101
|
- CHANGES
|
102
102
|
- MANIFEST
|
103
103
|
files:
|
104
|
+
- appveyor.yml
|
104
105
|
- certs
|
105
106
|
- certs/djberg96_pub.pem
|
106
107
|
- CHANGES
|
@@ -137,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
138
|
requirements:
|
138
139
|
- - ">="
|
139
140
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
141
|
+
version: 1.9.3
|
141
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
143
|
requirements:
|
143
144
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|