fix: use correct parameter for setgid and setuid

They were inverted.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
Samuel Gaist
2026-02-10 11:41:55 +01:00
parent 23ba06de51
commit ccbc4138e8

View File

@@ -73,13 +73,13 @@ void falco_webserver::start(const falco::app::state &state,
throw falco_exception("Webserver: an error occurred while forking webserver");
} else if(m_pid == 0) {
falco_logger::log(falco_logger::level::INFO, "Webserver: forked\n");
int res = setgid(webserver_config.m_uid);
int res = setgid(webserver_config.m_gid);
if(res != NOERROR) {
throw falco_exception(
std::string("Webserver: an error occurred while setting group id: ") +
std::strerror(errno));
}
res = setuid(webserver_config.m_gid);
res = setuid(webserver_config.m_uid);
if(res != NOERROR) {
throw falco_exception(
std::string("Webserver: an error occurred while setting user id: ") +