win32-file-security 1.0.1 → 1.0.2
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/lib/win32/file/security/functions.rb +19 -18
- data/lib/win32/file/security.rb +4 -4
- data/test/test_win32_file_security_version.rb +1 -1
- data/win32-file-security.gemspec +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
@@ -19,39 +19,40 @@ module Windows
|
|
19
19
|
typedef :buffer_in, :buf_in
|
20
20
|
typedef :buffer_out, :buf_out
|
21
21
|
typedef :string, :str
|
22
|
-
|
22
|
+
typedef :ulong, :dword
|
23
|
+
typedef :uintptr_t, :handle
|
23
24
|
|
24
25
|
ffi_lib :advapi32
|
25
26
|
|
26
|
-
attach_pfunc :AddAce, [:ptr, :
|
27
|
-
attach_pfunc :AdjustTokenPrivileges, [:
|
28
|
-
attach_pfunc :CopySid, [:
|
27
|
+
attach_pfunc :AddAce, [:ptr, :dword, :dword, :ptr, :dword], :bool
|
28
|
+
attach_pfunc :AdjustTokenPrivileges, [:handle, :bool, :ptr, :dword, :ptr, :ptr], :bool
|
29
|
+
attach_pfunc :CopySid, [:dword, :ptr, :ptr], :bool
|
29
30
|
attach_pfunc :EncryptFileW, [:buf_in], :bool
|
30
|
-
attach_pfunc :DecryptFileW, [:buf_in, :
|
31
|
+
attach_pfunc :DecryptFileW, [:buf_in, :dword], :bool
|
31
32
|
attach_pfunc :FileEncryptionStatusW, [:buf_in, :ptr], :bool
|
32
|
-
attach_pfunc :GetAce, [:ptr, :
|
33
|
-
attach_pfunc :GetFileSecurityW, [:buf_in, :
|
34
|
-
attach_pfunc :GetLengthSid, [:ptr], :
|
33
|
+
attach_pfunc :GetAce, [:ptr, :dword, :ptr], :bool
|
34
|
+
attach_pfunc :GetFileSecurityW, [:buf_in, :dword, :ptr, :dword, :ptr], :bool
|
35
|
+
attach_pfunc :GetLengthSid, [:ptr], :dword
|
35
36
|
attach_pfunc :GetSecurityDescriptorControl, [:ptr, :ptr, :ptr], :bool
|
36
37
|
attach_pfunc :GetSecurityDescriptorOwner, [:ptr, :ptr, :ptr], :bool
|
37
|
-
attach_pfunc :GetSecurityDescriptorDacl, [:ptr, :ptr, :ptr, :ptr], :
|
38
|
-
attach_pfunc :GetSecurityInfo, [:
|
39
|
-
attach_pfunc :GetTokenInformation, [:
|
40
|
-
attach_pfunc :InitializeAcl, [:ptr, :
|
41
|
-
attach_pfunc :InitializeSecurityDescriptor, [:ptr, :
|
38
|
+
attach_pfunc :GetSecurityDescriptorDacl, [:ptr, :ptr, :ptr, :ptr], :bool
|
39
|
+
attach_pfunc :GetSecurityInfo, [:handle, :dword, :dword, :ptr, :ptr, :ptr, :ptr, :ptr], :dword
|
40
|
+
attach_pfunc :GetTokenInformation, [:handle, :int, :ptr, :dword, :ptr], :bool
|
41
|
+
attach_pfunc :InitializeAcl, [:ptr, :dword, :dword], :bool
|
42
|
+
attach_pfunc :InitializeSecurityDescriptor, [:ptr, :dword], :bool
|
42
43
|
attach_pfunc :LookupAccountNameW, [:buf_in, :buf_in, :ptr, :ptr, :ptr, :ptr, :ptr], :bool
|
43
44
|
attach_pfunc :LookupAccountSidW, [:buf_in, :ptr, :ptr, :ptr, :ptr, :ptr, :ptr], :bool
|
44
45
|
attach_pfunc :LookupPrivilegeValueA, [:str, :str, :ptr], :bool
|
45
|
-
attach_pfunc :OpenProcessToken, [:
|
46
|
-
attach_pfunc :SetFileSecurityW, [:buf_in, :
|
46
|
+
attach_pfunc :OpenProcessToken, [:handle, :dword, :ptr], :bool
|
47
|
+
attach_pfunc :SetFileSecurityW, [:buf_in, :dword, :ptr], :bool
|
47
48
|
attach_pfunc :SetSecurityDescriptorDacl, [:ptr, :bool, :ptr, :bool], :bool
|
48
49
|
attach_pfunc :SetSecurityDescriptorOwner, [:ptr, :ptr, :bool], :bool
|
49
50
|
|
50
51
|
ffi_lib :kernel32
|
51
52
|
|
52
|
-
attach_pfunc :CloseHandle, [:
|
53
|
-
attach_pfunc :GetCurrentProcess, [], :
|
54
|
-
attach_pfunc :GetVolumeInformationW, [:buf_in, :buf_out, :
|
53
|
+
attach_pfunc :CloseHandle, [:handle], :bool
|
54
|
+
attach_pfunc :GetCurrentProcess, [], :handle
|
55
|
+
attach_pfunc :GetVolumeInformationW, [:buf_in, :buf_out, :dword, :ptr, :ptr, :ptr, :buf_out, :dword], :bool
|
55
56
|
|
56
57
|
ffi_lib :shlwapi
|
57
58
|
|
data/lib/win32/file/security.rb
CHANGED
@@ -12,7 +12,7 @@ class File
|
|
12
12
|
extend Windows::File::Functions
|
13
13
|
|
14
14
|
# The version of the win32-file library
|
15
|
-
WIN32_FILE_SECURITY_VERSION = '1.0.
|
15
|
+
WIN32_FILE_SECURITY_VERSION = '1.0.2'
|
16
16
|
|
17
17
|
class << self
|
18
18
|
remove_method(:owned?)
|
@@ -25,7 +25,7 @@ class File
|
|
25
25
|
# * encrypted
|
26
26
|
# * readonly
|
27
27
|
# * root directory (i.e. not encryptable)
|
28
|
-
# * system
|
28
|
+
# * system file (i.e. not encryptable)
|
29
29
|
# * unsupported
|
30
30
|
# * unknown
|
31
31
|
#
|
@@ -211,14 +211,14 @@ class File
|
|
211
211
|
dacl_present_ptr = FFI::MemoryPointer.new(:bool)
|
212
212
|
dacl_defaulted_ptr = FFI::MemoryPointer.new(:ulong)
|
213
213
|
|
214
|
-
|
214
|
+
bool = GetSecurityDescriptorDacl(
|
215
215
|
security_ptr,
|
216
216
|
dacl_present_ptr,
|
217
217
|
dacl_pptr,
|
218
218
|
dacl_defaulted_ptr
|
219
219
|
)
|
220
220
|
|
221
|
-
|
221
|
+
unless bool
|
222
222
|
raise SystemCallError.new("GetSecurityDescriptorDacl", FFI.errno)
|
223
223
|
end
|
224
224
|
|
@@ -8,6 +8,6 @@ require 'win32/file/security'
|
|
8
8
|
|
9
9
|
class TC_Win32_File_Security_Version < Test::Unit::TestCase
|
10
10
|
test "version is set to expected value" do
|
11
|
-
assert_equal('1.0.
|
11
|
+
assert_equal('1.0.2', File::WIN32_FILE_SECURITY_VERSION)
|
12
12
|
end
|
13
13
|
end
|
data/win32-file-security.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-file-security
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-04-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|