Skip to content

Commit f731fe6

Browse files
committed
Patch uid param
1 parent e597e0f commit f731fe6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

localexec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (l LocalExecer) Start(ctx context.Context, c Command) (Process, error) {
8484
process.cmd.SysProcAttr.Credential.Gid = c.GID
8585
}
8686
if c.UID != 0 {
87-
process.cmd.SysProcAttr.Credential.Gid = c.UID
87+
process.cmd.SysProcAttr.Credential.Uid = c.UID
8888
}
8989

9090
if c.TTY {

server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ func pipeProcessOutput(ctx context.Context, process Process, conn net.Conn) {
133133
stdout = process.Stdout()
134134
stderr = process.Stderr()
135135
)
136-
go pipeReaderWithHeader(stdout, conn, proto.Header{Type: proto.TypeStdout})
137-
go pipeReaderWithHeader(stderr, conn, proto.Header{Type: proto.TypeStderr})
136+
go copyWithHeader(stdout, conn, proto.Header{Type: proto.TypeStdout})
137+
go copyWithHeader(stderr, conn, proto.Header{Type: proto.TypeStderr})
138138
}
139139

140-
func pipeReaderWithHeader(r io.Reader, w io.WriteCloser, header proto.Header) {
140+
func copyWithHeader(r io.Reader, w io.Writer, header proto.Header) {
141141
headerByt, err := json.Marshal(header)
142142
if err != nil {
143143
return

0 commit comments

Comments
 (0)