From a324853818fd75d7ec11c68de9d499f37228b26a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 14 Oct 2013 16:20:11 -0400 Subject: Allow arbitrary users to connect to a service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rpc.gssd daemon is changing to fork and change uid to the unprivileged user it wants to authenticate, this means gssproxy needs to allow connection from any euid. When this is done though, the trusted flag needs to be dropped, if the connecting euid does not match the default trusted uid to prevent improper impersonation. Resolves: https://fedorahosted.org/gss-proxy/ticket/103 Reviewed-by: Günther Deschner name, gpsvc->euid, gpsvc->socket); + proc, gp_rpc_procname(proc), gpcall->service->name, + gp_conn_get_uid(gpcall->connection), gpcall->service->socket); - return gp_xdr_set[proc].exec_fn(gpctx, gpsvc, arg, res); + return gp_xdr_set[proc].exec_fn(gpcall, arg, res); } static int gp_rpc_return_buffer(XDR *xdr_reply_ctx, char *reply_buffer, @@ -371,8 +371,7 @@ static void gp_rpc_free_xdrs(int proc, xdr_free(gp_xdr_set[proc].res_fn, (char *)res); } -int gp_rpc_process_call(struct gssproxy_ctx *gpctx, - struct gp_service *gpsvc, +int gp_rpc_process_call(struct gp_call_ctx *gpcall, uint8_t *inbuf, size_t inlen, uint8_t **outbuf, size_t *outlen) { @@ -398,7 +397,7 @@ int gp_rpc_process_call(struct gssproxy_ctx *gpctx, ret = gp_rpc_decode_call(&xdr_call_ctx, &xid, &proc, &arg, &acc, &rej); if (!ret) { /* execute request */ - ret = gp_rpc_execute(gpctx, gpsvc, proc, &arg, &res); + ret = gp_rpc_execute(gpcall, proc, &arg, &res); if (ret) { acc = GP_RPC_SYSTEM_ERR; ret = EINVAL; -- cgit