X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fgssd%2Fsvcgssd_proc.c;h=c714d99dd654aaff3b3369bebcbc0df0946284dd;hp=3894078e81568e4f78d0a18bef8cb5e2e7528191;hb=cf5b38e707b629540b5123124228311a620e3dce;hpb=bc8fdd5ebcabe57cacd382673ca9e4a79ff7b18e diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c index 3894078..c714d99 100644 --- a/utils/gssd/svcgssd_proc.c +++ b/utils/gssd/svcgssd_proc.c @@ -56,7 +56,9 @@ #include "gss_util.h" #include "err_util.h" #include "context.h" +#include "misc.h" #include "gss_oids.h" +#include "svcgssd_krb5.h" extern char * mech2file(gss_OID mech); #define SVCGSSD_CONTEXT_CHANNEL "/proc/net/rpc/auth.rpcsec.context/channel" @@ -70,6 +72,7 @@ struct svc_cred { int cr_ngroups; gid_t cr_groups[NGROUPS]; }; +static char vbuf[RPC_CHAN_BUF_SIZE]; static int do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred, @@ -91,6 +94,7 @@ do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred, SVCGSSD_CONTEXT_CHANNEL, strerror(errno)); goto out_err; } + setvbuf(f, vbuf, _IOLBF, RPC_CHAN_BUF_SIZE); qword_printhex(f, out_handle->value, out_handle->length); /* XXX are types OK for the rest of this? */ /* For context cache, use the actual context endtime */ @@ -241,7 +245,7 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred) "file for name '%s'\n", sname); goto out_free; } - nfs4_init_name_mapping(NULL); /* XXX: should only do this once */ + res = nfs4_gss_princ_to_ids(secname, sname, &uid, &gid); if (res < 0) { /* @@ -443,6 +447,10 @@ handle_nullreq(FILE *f) { memcpy(&ctx, in_handle.value, in_handle.length); } + if (svcgssd_limit_krb5_enctypes()) { + goto out_err; + } + maj_stat = gss_accept_sec_context(&min_stat, &ctx, gssd_creds, &in_tok, GSS_C_NO_CHANNEL_BINDINGS, &client_name, &mech, &out_tok, &ret_flags, NULL, NULL);