Skip to content

Commit 9d0725c

Browse files
committed
fix lint
1 parent 16fd983 commit 9d0725c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/pkg/agent/application/upgrade/watcher_windows.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func signalPID(log *logger.Logger, pid int) error {
122122
// Normally we would want to send the Ctrl+Break event only to the watcher process but due to the fact that
123123
// the parent process of the watcher has already terminated, we have to hug it tightly and take it down with us
124124
// by specifying processGroupID=0
125+
//nolint:gosec // int -> uint32 no overflow is possible since windows PID is a DWORD (uint32) (see https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getprocessid and https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types)
125126
killProcErr := windows.GenerateConsoleCtrlEvent(windows.CTRL_BREAK_EVENT, uint32(pid))
126127

127128
if killProcErr != nil {
@@ -135,6 +136,7 @@ func isProcessLive(process *os.Process) (bool, error) {
135136
//exitCodeStillActive according to https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess
136137
const exitCodeStillActive = 259
137138
// Open the process with PROCESS_QUERY_LIMITED_INFORMATION access
139+
//nolint:gosec // int -> uint32 no overflow is possible since windows PID is a DWORD (uint32) (see https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getprocessid and https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types)
138140
handle, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(process.Pid))
139141
if err != nil {
140142
return false, fmt.Errorf("OpenProcess failed: %w", err)

0 commit comments

Comments
 (0)