plugins: validate logmon process during reattach (#24798)

This commit is contained in:
Michael Smithhisler
2025-01-08 08:50:33 -05:00
committed by GitHub
parent 679642c8bf
commit 34a34e7233
2 changed files with 13 additions and 0 deletions

3
.changelog/24798.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
drivers: validate logmon plugin during reattach
```

View File

@@ -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
}