]> git.puffer.fish Git - mirror/frr.git/commit
libs: make privs elevation thread-safe 3913/head
authorMark Stapp <mjs@voltanet.io>
Wed, 6 Mar 2019 15:41:47 +0000 (10:41 -0500)
committerMark Stapp <mjs@voltanet.io>
Wed, 6 Mar 2019 15:41:47 +0000 (10:41 -0500)
commiteaed2ea52d339abf9edc9735a1eb66246aec6624
tree4d6ead8491321245ee54937ba59124b4c6cb56b8
parentccbed70c5644a03224a073e5862fabf1fa03706a
libs: make privs elevation thread-safe

[Double-commit PR 3911 to 7.0] Privs elevation is per-process,
and can deadlock if a multiple threads drive into the uid system
call. Add a refcount and a mutex to avoid reentrant calls to
the OS.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/privs.c
lib/privs.h