On Sun, Mar 16, 2014 at 09:21:41PM +0100, Tom Payne wrote:
> I'm developing on Mac OS X but deploying to Linux. I can cross-compile my
> binary just fine, but when I run it on Linux I get the error:
> user: LookupId not implemented on linux/386
>
> I want to drop privileges for my server process via the Setuid function in
> the syscall package. I'm use the Lookup and LookupId functions in the
> os/user package to convert a string username to a user id.
Obviously not a solution the general problem, but in this case,
you may want to use runit's chpst or similar tool and avoid
handling user privileges in your app.
I develop and deploy on Linux and almost always use external tools for process state management.
It has the beneficial effects of simplifying the application,
eliminating a whole class of security issues, and providing
more flexibility in deployment configurations.
Of course, your application may well be the rare one that requires root
privileges by design...
-Gyepi