Skip to content

Commit

Permalink
miniupnpd: use capng_init instead of capng_setpid
Browse files Browse the repository at this point in the history
capng_setpid is use for setting capabilities for a different process.
  • Loading branch information
ptpt52 committed Apr 30, 2024
1 parent 2d2ef99 commit 08f68c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miniupnpd/miniupnpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ main(int argc, char * * argv)
}
#endif /* HAS_LIBCAP */
#ifdef HAS_LIBCAP_NG
capng_setpid(getpid());
capng_init();
capng_clear(CAPNG_SELECT_BOTH);
if (capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED, CAP_NET_BROADCAST, CAP_NET_ADMIN, CAP_NET_RAW, -1) < 0) {
syslog(LOG_ERR, "capng_updatev() failed");
Expand Down

0 comments on commit 08f68c7

Please sign in to comment.