* src/nethogs.h: Undo accidental commit.

* src/main.cpp: Properly commit this change.
This commit is contained in:
rain1
2016-04-14 12:41:34 +00:00
parent 2ab1306246
commit b2f008c568
2 changed files with 4 additions and 2 deletions

View File

@@ -177,9 +177,11 @@ int main(int argc, char **argv) {
if (geteuid() != 0)
forceExit(false, "You need to be root to run NetHogs!");
#else
char exe_path[PATH_MAX];
unsigned int caps[5] = {0};
getxattr(argv[0], "security.capability", (char *)caps, sizeof(caps));
readlink("/proc/self/exe", exe_path, PATH_MAX);
getxattr(exe_path, "security.capability", (char *)caps, sizeof(caps));
if (((caps[1] >> CAP_NET_ADMIN) & 1) != 1)
forceExit(false, "You need to enable cap_net_admin (and cap_net_raw) to run NetHogs!");