Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Ronny Bangsund
On Saturday, August 31, 2019 at 3:14:28 PM UTC+2, Jakob Borg wrote: > > On 31 Aug 2019, at 12:33, Ronny Bangsund > wrote: > > > Digging through my vast mess of code, I found this function which sets the > real and effective user (Setreuid) of the calling process: > func DegradeToUser(uname

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Jakob Borg
On 31 Aug 2019, at 12:33, Ronny Bangsund mailto:ronny.bangs...@gmail.com>> wrote: Digging through my vast mess of code, I found this function which sets the real and effective user (Setreuid) of the calling process: func DegradeToUser(uname string) error { Doesn't this suffer from the issue of

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Ronny Bangsund
On Saturday, August 31, 2019 at 10:07:59 AM UTC+2, Chris Burkert wrote: > > is there some code available to dig into that? I plan to do something > similar that a regular user process starts up a kind of a root broker which > starts several other processes as different users. > You would by

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Chris Burkert
Dear Kevin, is there some code available to dig into that? I plan to do something similar that a regular user process starts up a kind of a root broker which starts several other processes as different users. Especially for the communication part I don’t have a good and secure idea so far. thanks

Re: [go-nuts] How to execute a command using root?

2019-08-30 Thread Kevin Chadwick
On 8/30/19 7:49 AM, Benjamin wrote: > Do anyone have any suggestions on this? Thanks Sudo is an option. I prefer to have a master root process that spawns workers processes that drop privileges via setegid...seteuid... syscalls to dedicated users for various tasks. Takes concurrency to the next

Re: [go-nuts] How to execute a command using root?

2019-08-30 Thread Benjamin
Yes, it works. Thank you very much! 在 2019年8月30日星期五 UTC+8下午2:56:50,Jakob Borg写道: > > On 30 Aug 2019, at 08:49, Benjamin > > wrote: > > > Then I tried to use "sudo" to execute the command, but the environment > variables can't be carried over into the command; > > > This is a sudo configuration

Re: [go-nuts] How to execute a command using root?

2019-08-30 Thread Jakob Borg
On 30 Aug 2019, at 08:49, Benjamin mailto:wangchao.nlp@gmail.com>> wrote: Then I tried to use "sudo" to execute the command, but the environment variables can't be carried over into the command; This is a sudo configuration issue. See sudo --preserve-env etc. Best regards, Jakob -- You

Re: [go-nuts] How to execute a command using root?

2019-08-30 Thread Jan Mercl
On Fri, Aug 30, 2019 at 8:53 AM Jan Mercl <0xj...@gmail.com> wrote: > Moreover, it should not be possible. But whitelisting certain users to run certain programs using sudo, but no password, is possible. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] How to execute a command using root?

2019-08-30 Thread Jan Mercl
On Fri, Aug 30, 2019 at 8:49 AM Benjamin wrote: >Do anyone have any suggestions on this? Thanks. IINM, what you want is not possible. Moreover, it should not be possible. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] How to execute a command using root?

2019-08-30 Thread Benjamin
Hi, I need to execute a couple of commands in golang, the code is roughly as below, cmd := exec.Command(executable, newArgs...) if env != nil && len(env) > 0 { cmd.Env = env } outMsg, err := cmd.CombinedOutput() if err != nil { .. } Executing the