HomePhorge

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

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
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUc95aafe78b90: Merge pull request #193 from daniel-pittman/feature/2.7.x/9508-auth-any…
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU7eb0197f33bc: (#10614) Fix error checking for Windows BOOL return values (authored by Josh Cooper <josh@puppetlabs.com>).Nov 9 2011, 12:29 AM