HomePhorge

(#10614) Fix error checking for Windows BOOL return values
ed27a90c0919Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(#10614) Fix error checking for Windows BOOL return values

Previously, the agent could segfault when attempting to manage a DACL
on a non-NTFS filesystem. The problem was that we were incorrectly
checking the return value from several of the Windows APIs due to the
windows gems automatically converting BOOL values into ruby true/false
values.

For example, this call returns a ruby true/false value:

API.new('IsValidAcl', 'P', 'B', 'advapi32')

But this one will return an integer value:

API.new('GetSecurityInfo', 'LLLPPPPP', 'L', 'advapi32')

The crash is now fixed because we correctly raise an exception when
IsValidAcl returns false.

Paired-with: Nick Lewis <nick@puppetlabs.com>

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
Jacob Helwig <jacob@puppetlabs.com>Committed on Nov 11 2011, 9:23 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU50c9394caaa1: Merge remote-tracking branch 'josh/ticket/2.7.x/9983-binary-mode-windows'…
Branches
Unknown
Tags
Unknown

Event Timeline

Jacob Helwig <jacob@puppetlabs.com> committed rPUed27a90c0919: (#10614) Fix error checking for Windows BOOL return values (authored by Josh Cooper <josh@puppetlabs.com>).Nov 11 2011, 9:23 PM