3. Make mtr-packet a setuid-root binary.
The mtr-packet binary can be made setuid-root, which is what "make install"
-does by default.
+does only if using setcap (above) fails. Using setcap is tried first.
When mtr-packet is installed as suid-root, some concern over security is
justified. mtr-packet does the following two things after it is launched:
----------------------------------------------------------------------
+- cleanup
+ - cleanup warnings that the newer GCC produces.
- Stuff to implement:
{
int i;
char *b = buff;
- for (i = (sizeof(*addr) / 2 - 1); i >= 0; i--, b += 4) /* 64b portion */
+ // We need to process the top 64 bits, or 8 bytes.
+ for (i = 8-1; i >= 0; i--, b += 4, buff_length -= 4)
snprintf(b, buff_length,
"%x.%x.", addr->s6_addr[i] & 0xf, addr->s6_addr[i] >> 4);
-
- buff[strlen(buff) - 1] = '\0';
+ *--b = 0;
}
#endif