17175: Fix logging label for setuidgid-wrapped procs.
[arvados.git] / lib / boot / supervisor.go
index 3484a1444e786cc5f026f0d0a68ada822b79ffb1..a85a699c3cd1df0a4fb19068e4d764ebdbbf82ca 100644 (file)
@@ -438,9 +438,9 @@ func (super *Supervisor) lookPath(prog string) string {
        return prog
 }
 
-// Run prog with args, using dir as working directory. If ctx is
-// cancelled while the child is running, RunProgram terminates the
-// child, waits for it to exit, then returns.
+// RunProgram runs prog with args, using dir as working directory. If ctx is
+// cancelled while the child is running, RunProgram terminates the child, waits
+// for it to exit, then returns.
 //
 // Child's environment will have our env vars, plus any given in env.
 //
@@ -451,8 +451,8 @@ func (super *Supervisor) RunProgram(ctx context.Context, dir string, output io.W
        super.logger.WithField("command", cmdline).WithField("dir", dir).Info("executing")
 
        logprefix := prog
-       if logprefix == "setuidgid" && len(args) >= 3 {
-               logprefix = args[2]
+       if logprefix == "setuidgid" && len(args) >= 2 {
+               logprefix = args[1]
        }
        logprefix = strings.TrimPrefix(logprefix, super.tempdir+"/bin/")
        if logprefix == "bundle" && len(args) > 2 && args[0] == "exec" {