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 CHANGED
@@ -1,3 +1,7 @@
1
+ = 1.0.2 - 8-Apr-2013
2
+ * Fixed HANDLE prototype in underlying FFI code. This affects 64 bit
3
+ versions of Ruby.
4
+
1
5
  = 1.0.1 - 1-Jan-2013
2
6
  * Added a working implementation of File.owned?
3
7
  * Added a working implementation of File.chown.
@@ -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, :ulong, :ulong, :ptr, :ulong], :bool
27
- attach_pfunc :AdjustTokenPrivileges, [:ulong, :bool, :ptr, :ulong, :ptr, :ptr], :bool
28
- attach_pfunc :CopySid, [:ulong, :ptr, :ptr], :bool
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, :ulong], :bool
31
+ attach_pfunc :DecryptFileW, [:buf_in, :dword], :bool
31
32
  attach_pfunc :FileEncryptionStatusW, [:buf_in, :ptr], :bool
32
- attach_pfunc :GetAce, [:ptr, :ulong, :ptr], :bool
33
- attach_pfunc :GetFileSecurityW, [:buf_in, :ulong, :ptr, :ulong, :ptr], :bool
34
- attach_pfunc :GetLengthSid, [:ptr], :ulong
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], :ulong
38
- attach_pfunc :GetSecurityInfo, [:ulong, :ulong, :ulong, :ptr, :ptr, :ptr, :ptr, :ptr], :ulong
39
- attach_pfunc :GetTokenInformation, [:ulong, :int, :ptr, :ulong, :ptr], :bool
40
- attach_pfunc :InitializeAcl, [:ptr, :ulong, :ulong], :bool
41
- attach_pfunc :InitializeSecurityDescriptor, [:ptr, :ulong], :bool
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, [:ulong, :ulong, :ptr], :bool
46
- attach_pfunc :SetFileSecurityW, [:buf_in, :ulong, :ptr], :bool
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, [:ulong], :bool
53
- attach_pfunc :GetCurrentProcess, [], :ulong
54
- attach_pfunc :GetVolumeInformationW, [:buf_in, :buf_out, :ulong, :ptr, :ptr, :ptr, :buf_out, :ulong], :bool
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
 
@@ -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.1'
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 fiel (i.e. not encryptable)
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
- val = GetSecurityDescriptorDacl(
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
- if val == 0
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.1', File::WIN32_FILE_SECURITY_VERSION)
11
+ assert_equal('1.0.2', File::WIN32_FILE_SECURITY_VERSION)
12
12
  end
13
13
  end
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-file-security'
5
- spec.version = '1.0.1'
5
+ spec.version = '1.0.2'
6
6
  spec.authors = ['Daniel J. Berger', 'Park Heesob']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
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.1
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-01-01 00:00:00.000000000 Z
13
+ date: 2013-04-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi