Re: [fpc-pascal] How to detect if my program is running with root/elevated privileges?

2013-10-29 Thread Mark Morgan Lloyd
Bart wrote: On 10/28/13, Mark Morgan Lloyd wrote: For windows there is winutils.iswindowsadmin(), for unix likes there is fpgeteuid (which should return zero for root). Also remember unix-style capabilities. Care to elaborate on that? You can use the setcap utility to add or remove capab

Re: [fpc-pascal] How to detect if my program is running with root/elevated privileges?

2013-10-28 Thread Bart
On 10/28/13, Mark Morgan Lloyd wrote: >>> For windows there is winutils.iswindowsadmin(), for unix likes there is >>> fpgeteuid (which should return zero for root). >> > > Also remember unix-style capabilities. > Care to elaborate on that? Bart ___ fp

Re: [fpc-pascal] How to detect if my program is running with root/elevated privileges?

2013-10-28 Thread Mark Morgan Lloyd
Bart wrote: On 10/27/13, Marco van de Voort wrote: For windows there is winutils.iswindowsadmin(), for unix likes there is fpgeteuid (which should return zero for root). Thanks a lot. Also remember unix-style capabilities. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions

Re: [fpc-pascal] How to detect if my program is running with root/elevated privileges?

2013-10-27 Thread Bart
On 10/27/13, Marco van de Voort wrote: > For windows there is winutils.iswindowsadmin(), for unix likes there is > fpgeteuid (which should return zero for root). Thanks a lot. Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

Re: [fpc-pascal] How to detect if my program is running with root/elevated privileges?

2013-10-27 Thread Marco van de Voort
In our previous episode, Bart said: > > I thought of trying to write to a "protected" location (/etc/something > on linux, C:\ProgramData\something on Windows), but the problem is > that Windows virtualizes these calls (it'll end up somewhere lse, > where your program will never find it again), so

[fpc-pascal] How to detect if my program is running with root/elevated privileges?

2013-10-27 Thread Bart
Hi, In my program I have some functions that must only be enabled if the program is invoked as root (linux) / administrator (windows). Is there some cross platform way to detect this? I thought of trying to write to a "protected" location (/etc/something on linux, C:\ProgramData\something on Win