Skip to content

Commit

Permalink
backport of commit 34a34e7 (#24808)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Smithhisler <[email protected]>
  • Loading branch information
1 parent d991bf0 commit a6da295
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/24798.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
drivers: validate logmon plugin during reattach
```
10 changes: 10 additions & 0 deletions client/logmon/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ func LaunchLogMon(logger hclog.Logger, reattachConfig *plugin.ReattachConfig) (L
return nil, nil, err
}

// Note: Similar to reattaching to executors, Go-plugin uses localhost
// ports on Windows. On reattach, it may attach to another process
// listening on that port. We should validate it is actually a plugin.
if conf.Reattach != nil {
if err := rpcClient.Ping(); err != nil {
logger.Warn("failed to ping plugin process during reattach", "error", err)
return nil, nil, err
}
}

l := raw.(LogMon)
return l, client, nil
}
Expand Down

0 comments on commit a6da295

Please sign in to comment.