Skip to content

Commit d87d3d9

Browse files
committed
fix: reset cached uid/gid on re-init without a configured user
1 parent 68cd877 commit d87d3d9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ func (p *Plugin) Init(cfg Configurer, log NamedLogger) error {
5757

5858
p.log = log.NamedLogger(PluginName)
5959

60-
// resolve the configured run-as user's uid/gid once
60+
// resolve the configured run-as user's uid/gid once; reset first so a
61+
// re-Init without a configured user does not keep stale values
62+
p.uid, p.gid = 0, 0
6163
if p.cfg.User != "" {
6264
// process.ExecuteFromUser is a no-op on Windows, and Windows uids (SIDs)
6365
// are not numeric — reject the option explicitly instead of failing on Atoi.

0 commit comments

Comments
 (0)