mirror of
https://github.com/golang/go
synced 2024-11-20 09:44:45 -07:00
syscall: restrict access rights param of OpenProcess() to the minimum needed
Fixes #1270. R=vcc, rsc CC=golang-dev https://golang.org/cl/3299041
This commit is contained in:
parent
95c7adb050
commit
1e2876469b
@ -729,7 +729,8 @@ type WaitStatus struct {
|
||||
}
|
||||
|
||||
func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
|
||||
handle, errno := OpenProcess(PROCESS_ALL_ACCESS, 0, uint32(pid))
|
||||
const da = STANDARD_RIGHTS_READ | PROCESS_QUERY_INFORMATION | SYNCHRONIZE
|
||||
handle, errno := OpenProcess(da, 0, uint32(pid))
|
||||
if errno != 0 {
|
||||
return 0, errno
|
||||
}
|
||||
|
@ -112,6 +112,10 @@ const (
|
||||
WAIT_FAILED = 0xFFFFFFFF
|
||||
|
||||
CREATE_UNICODE_ENVIRONMENT = 0x00000400
|
||||
|
||||
STANDARD_RIGHTS_READ = 0x00020000
|
||||
PROCESS_QUERY_INFORMATION = 0x00000400
|
||||
SYNCHRONIZE = 0x00100000
|
||||
)
|
||||
|
||||
const (
|
||||
@ -478,10 +482,3 @@ type DNSRecord struct {
|
||||
Reserved uint32
|
||||
Data [40]byte
|
||||
}
|
||||
|
||||
const (
|
||||
HANDLE_FLAG_INHERIT = 0x00000001
|
||||
HANDLE_FLAG_PROTECT_FROM_CLOSE = 0x00000002
|
||||
|
||||
PROCESS_ALL_ACCESS = 0x001fffff
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user