[fpc-pascal] Help getting Lazarus app in Ubuntu to elevate to root and back again

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sun Oct 10 20:09:41 CEST 2010


Andrew Brunner wrote:
> I'm needing help to take my Lazarus app, elevate process to root
> (using GUI prompt like GKSU) and I want to drop back down to the
> user's level after port binding and listening.
> 
> Ubuntu has port restrictions for low port numbers.  I'm developing a
> platform that happens to use ports for HTTP, XMPP, etc.  Unfortunately
> I find myself running Lazarus as root and that is messing up my units
> as they are saved.

Could you suid it to root or to an appropriate group? I've not tried 
this for a Pascal/Lazarus program and don't know what the precise rules 
are for port usage (i.e. whether the user has to be root or using the 
root group is sufficient), but for a C program accessing a video capture 
device I use

   chown root:video v4lgrab
   chmod g+s v4lgrab

That then allows the program to be run as part of an unprivileged CGI 
script.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list