]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sock: set conn->err_code in case of EPERM next
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 21 May 2024 17:24:37 +0000 (19:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 May 2024 18:14:31 +0000 (20:14 +0200)
To improve the readability of sock_handle_system_err(), let's
set explicitly conn->err_code as CO_ER_SOCK_ERR in case of EPERM
(could be returned by setns syscall).

src/sock.c

index 3961f4f926917e2dcd5869fe96d443d855b0801f..6b23c9cebc33a4753b27820481b5caa88a2c7e6c 100644 (file)
@@ -237,6 +237,7 @@ static int sock_handle_system_err(struct connection *conn, struct proxy *be)
                        break;
 
                case EPERM:
+                       conn->err_code = CO_ER_SOCK_ERR;
                        send_log(be, LOG_EMERG,
                                 "Proxy %s has insufficient permissions to open server socket.\n",
                                 be->id);