Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Request lowest access privilege required in Windows OpenProcess calls #50
Gosigar requests PROCESS_ALL_ACCESS permission but the operation that it performs, GetProcessMemoryInfo, requires only PROCESS_QUERY_INFORMATION and PROCESS_VM_READ. gosigar should only request the permissions that it requires.
In other parts of gosigar it requests PROCESS_QUERY_INFORMATION, but in Windows Vista and newer there is a more limited privilege we can request called PROCESS_QUERY_LIMITED_INFORMATION. This can be used for GetProcessTimes, GetProcessImageFileName, and GetExitCodeProcess. It cannot be used for OpenProcessToken.
referenced this pull request
Oct 13, 2016
Current coverage is 70.60% (diff: 69.56%)
@@ master #50 diff @@ ========================================== Files 10 10 Lines 1080 1099 +19 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 764 776 +12 - Misses 257 262 +5 - Partials 59 61 +2