I can not ping with Indy using Linux.  What do I do about this?

Previous  Top  Next

In Linux, Indy's TIdICMPClient requires root privileges to use raw sockets. The command-line ping can be used by most Linux users because the SUID bit is set and the binary is owned by "root".


Before telling you how to set this properly, we should point out that any executable file with the SUID bit set would cause the file to be executed with the privileges of the person that owns the file.   Because the file is owned by "root", the SUID bit would cause the program to have absolute privileges over everything and thus, could potentially cause unlimited damage to a system (be it accidentally or on purpose) and nothing would stop this.  Many troublemakers will try to abuse such programs to gain root privileges for themselves.  Thus, those types of programs have to be designed with extreme caution and security in mind.  Typically, this involves taking a lot of care with the code, reducing dependencies on external libraries, keeping the amount of code to a minimum, and verifying all input provided by a user. 


Often, many programs can do things without root privileges simply by using executing standard SUID programs and by piping input and output to that SUID program.


Please think very carefully about all of this.  If you still have to make your program SUID, do the following as root:


chown root.root myprogram

chmod u+s myprogram