Skip to content
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

Please support setuid based on command line argument #4917

Closed
yurivict opened this issue Oct 11, 2021 · 5 comments
Closed

Please support setuid based on command line argument #4917

yurivict opened this issue Oct 11, 2021 · 5 comments
Labels

Comments

@yurivict
Copy link

It would be beneficial to run coredns as a regular user but without it supporting setuid this is impossible.

See the downstream feature request: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259054

Environment:

  • the version of CoreDNS:
  • Corefile: 1.8.6
  • OS: FreeBSD 13
@yurivict yurivict added the bug label Oct 11, 2021
@yurivict yurivict changed the title Please support setuid based on command line arguments Please support setuid based on command line argument Oct 11, 2021
@miekg
Copy link
Member

miekg commented Oct 11, 2021 via email

@ohreally
Copy link

Hi,

I admit that Go is one of the languages I haven't tried yet, so I absolutely don't want to lecture you.
But I also know that as programmers, when we have a certain limitation for a language in our heads, we sometimes keep it there longer than we should.
So without pretending that I know better: https://stackoverflow.com/questions/41248866/golang-dropping-privileges-v1-7
It looks rather simple to me. Feel free to correct me if I'm wrong.

Cheers,
Rob

@miekg
Copy link
Member

miekg commented Oct 11, 2021 via email

@corbot corbot bot closed this as completed Oct 11, 2021
@ohreally
Copy link

Well, first of all, there's no systemd on FreeBSD (as on many Linux systems).
And second of all, your solution is a hack at most, while there is a solution called setuid which has been around since the early 1970s.

@yurivict
Copy link
Author

yurivict commented Nov 6, 2021

dropping perms in Go is hard(er) than it should be and there is nothing in the std lib that allows you to do it.

Golang's syscall.Setuid can be used to setuid.

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

No branches or pull requests

3 participants