From a14cb37d199fec9227f668fe107bf38f99b8b842 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 22 Dec 2013 16:13:56 -0500 Subject: Add support for dropping privileges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the 'proxy user' configuation option is set in the [gssproxy] section then GSS Proxy will drop privileges to the specified after setting up all the sockets. Care must be taken to make sure all the resources the daemon need access to (keytabs, ccache directories, etc..) are accessible as the proxy user. Implements: https://fedorahosted.org/gss-proxy/ticket/102 Signed-off-by: Simo Sorce Reviewed-by: Günther Deschner --- proxy/src/gp_proxy.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'proxy/src/gp_proxy.h') diff --git a/proxy/src/gp_proxy.h b/proxy/src/gp_proxy.h index b6c64ae..733fec5 100644 --- a/proxy/src/gp_proxy.h +++ b/proxy/src/gp_proxy.h @@ -74,6 +74,8 @@ struct gp_config { struct gp_service **svcs; int num_svcs; + + char *proxy_user; /* user to drop privs to if not NULL */ }; struct gp_workers; @@ -109,6 +111,7 @@ void fini_server(void); verto_ctx *init_event_loop(void); void init_proc_nfsd(struct gp_config *cfg); void write_pid(void); +int drop_privs(struct gp_config *cfg); /* from gp_socket.c */ struct gp_sock_ctx *init_unix_socket(struct gssproxy_ctx *gpctx, -- cgit