Skip to content

Execute cmd in tinygo works differently? #2917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spaceslums opened this issue Jun 18, 2022 · 3 comments
Closed

Execute cmd in tinygo works differently? #2917

spaceslums opened this issue Jun 18, 2022 · 3 comments

Comments

@spaceslums
Copy link

In "fat" go this code

package main

import (
	"os"
	"os/exec"
	"strings"
)

func main() {
	cmd := exec.Command("su", "-c", "id")
	cmd.Stdin = strings.NewReader("toor")
	cmd.Stdout = os.Stdout
	cmd.Run()
}

works correctly and print uid=0(root) gid=0(root) groups=0(root). But in tinygo this code print nothing. Why?

@dankegel
Copy link
Contributor

Because exec is not yet supported in tinygo.

@spaceslums
Copy link
Author

@dankegel oh, okay.

@probonopd
Copy link

probonopd commented Aug 4, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants