For some reason, this bug was not catched before. It was expected that
`lldpcli` can be installed as suid `_lldpd` to give user read access to
the neighbor information. However, to avoid write access, we checked if
the user was privileged by checking equality of effective and real user
uid. However, even for root, they don't have to match. Maybe they
matched in the past?
Therefore, directly check for UID == 0 too.
This should fix #56
static int
is_privileged()
{
- return (!(getuid() != geteuid() || getgid() != getegid()));
+ return (getuid() == geteuid() && getgid() == getegid()) ||
+ getuid() == 0;
}
static char*