~ubuntu-branches/debian/stretch/nfs-utils/stretch

« back to all changes in this revision

Viewing changes to utils/gssd/svcgssd_proc.c

  • Committer: Bazaar Package Importer
  • Author(s): Luk Claes
  • Date: 2011-07-09 16:28:32 UTC
  • mfrom: (1.2.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20110709162832-ovaehe77pm3hyy35
Tags: 1:1.2.4-1
* New upstream version
  - Fix host_reliable_addrinfo (Closes: #633155)
  - Allow multiple RPC listeners to share listener port number
  (Closes: #619877)
  - Add --enable-libmount-mount (Closes: #626478)
  - 12-svcgssd-document-n-option.patch applied upstream
  - Refresh 19-exports.man-Fix-comment-syntax.patch
  - 21-anticipate-RLIMIT_FSIZE.patch applied upstream
  - Add nfsidmap binary and manpage
  - Use autoreconf to avoid build failure

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include "gss_util.h"
57
57
#include "err_util.h"
58
58
#include "context.h"
 
59
#include "misc.h"
59
60
#include "gss_oids.h"
 
61
#include "svcgssd_krb5.h"
60
62
 
61
63
extern char * mech2file(gss_OID mech);
62
64
#define SVCGSSD_CONTEXT_CHANNEL "/proc/net/rpc/auth.rpcsec.context/channel"
70
72
        int     cr_ngroups;
71
73
        gid_t   cr_groups[NGROUPS];
72
74
};
 
75
static char vbuf[RPC_CHAN_BUF_SIZE];
73
76
 
74
77
static int
75
78
do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
91
94
                             SVCGSSD_CONTEXT_CHANNEL, strerror(errno));
92
95
                goto out_err;
93
96
        }
 
97
        setvbuf(f, vbuf, _IOLBF, RPC_CHAN_BUF_SIZE);
94
98
        qword_printhex(f, out_handle->value, out_handle->length);
95
99
        /* XXX are types OK for the rest of this? */
96
100
        /* For context cache, use the actual context endtime */
241
245
                        "file for name '%s'\n", sname);
242
246
                goto out_free;
243
247
        }
244
 
        nfs4_init_name_mapping(NULL); /* XXX: should only do this once */
 
248
 
245
249
        res = nfs4_gss_princ_to_ids(secname, sname, &uid, &gid);
246
250
        if (res < 0) {
247
251
                /*
443
447
                memcpy(&ctx, in_handle.value, in_handle.length);
444
448
        }
445
449
 
 
450
        if (svcgssd_limit_krb5_enctypes()) {
 
451
                goto out_err;
 
452
        }
 
453
 
446
454
        maj_stat = gss_accept_sec_context(&min_stat, &ctx, gssd_creds,
447
455
                        &in_tok, GSS_C_NO_CHANNEL_BINDINGS, &client_name,
448
456
                        &mech, &out_tok, &ret_flags, NULL, NULL);