Deleted Added
full compact
nfs_nfsdkrpc.c (281962) nfs_nfsdkrpc.c (283600)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/fs/nfsserver/nfs_nfsdkrpc.c 281962 2015-04-25 00:58:24Z rmacklem $");
35__FBSDID("$FreeBSD: head/sys/fs/nfsserver/nfs_nfsdkrpc.c 283600 2015-05-27 09:20:42Z kib $");
36
37#include "opt_inet6.h"
38#include "opt_kgssapi.h"
39
40#include <fs/nfs/nfsport.h>
41
42#include <rpc/rpc.h>
43#include <rpc/rpcsec_gss.h>

--- 245 unchanged lines hidden (view full) ---

289 }
290 if (rp != NULL) {
291 nfsrvd_sentcache(rp, (rqst->rq_reply_seq != 0 ||
292 SVC_ACK(xprt, NULL)), rqst->rq_reply_seq);
293 }
294 svc_freereq(rqst);
295
296out:
36
37#include "opt_inet6.h"
38#include "opt_kgssapi.h"
39
40#include <fs/nfs/nfsport.h>
41
42#include <rpc/rpc.h>
43#include <rpc/rpcsec_gss.h>

--- 245 unchanged lines hidden (view full) ---

289 }
290 if (rp != NULL) {
291 nfsrvd_sentcache(rp, (rqst->rq_reply_seq != 0 ||
292 SVC_ACK(xprt, NULL)), rqst->rq_reply_seq);
293 }
294 svc_freereq(rqst);
295
296out:
297 if (softdep_ast_cleanup != NULL)
298 softdep_ast_cleanup();
297 NFSEXITCODE(0);
298}
299
300/*
301 * Check the cache and, optionally, do the RPC.
302 * Return the appropriate cache response.
303 */
304static int

--- 154 unchanged lines hidden (view full) ---

459/*
460 * Called by nfssvc() for nfsds. Just loops around servicing rpc requests
461 * until it is killed by a signal.
462 */
463int
464nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
465{
466 char principal[MAXHOSTNAMELEN + 5];
299 NFSEXITCODE(0);
300}
301
302/*
303 * Check the cache and, optionally, do the RPC.
304 * Return the appropriate cache response.
305 */
306static int

--- 154 unchanged lines hidden (view full) ---

461/*
462 * Called by nfssvc() for nfsds. Just loops around servicing rpc requests
463 * until it is killed by a signal.
464 */
465int
466nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
467{
468 char principal[MAXHOSTNAMELEN + 5];
469 struct proc *p;
467 int error = 0;
468 bool_t ret2, ret3, ret4;
469
470 error = copyinstr(args->principal, principal, sizeof (principal),
471 NULL);
472 if (error)
473 goto out;
474
475 /*
476 * Only the first nfsd actually does any work. The RPC code
477 * adds threads to it as needed. Any extra processes offered
478 * by nfsd just exit. If nfsd is new enough, it will call us
479 * once with a structure that specifies how many threads to
480 * use.
481 */
482 NFSD_LOCK();
483 if (newnfs_numnfsd == 0) {
470 int error = 0;
471 bool_t ret2, ret3, ret4;
472
473 error = copyinstr(args->principal, principal, sizeof (principal),
474 NULL);
475 if (error)
476 goto out;
477
478 /*
479 * Only the first nfsd actually does any work. The RPC code
480 * adds threads to it as needed. Any extra processes offered
481 * by nfsd just exit. If nfsd is new enough, it will call us
482 * once with a structure that specifies how many threads to
483 * use.
484 */
485 NFSD_LOCK();
486 if (newnfs_numnfsd == 0) {
487 p = td->td_proc;
488 PROC_LOCK(p);
489 p->p_flag2 |= P2_AST_SU;
490 PROC_UNLOCK(p);
484 newnfs_numnfsd++;
485
486 NFSD_UNLOCK();
487
488 /* An empty string implies AUTH_SYS only. */
489 if (principal[0] != '\0') {
490 ret2 = rpc_gss_set_svc_name_call(principal,
491 "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);

--- 15 unchanged lines hidden (view full) ---

507 rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2);
508 rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3);
509 rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4);
510 }
511
512 NFSD_LOCK();
513 newnfs_numnfsd--;
514 nfsrvd_init(1);
491 newnfs_numnfsd++;
492
493 NFSD_UNLOCK();
494
495 /* An empty string implies AUTH_SYS only. */
496 if (principal[0] != '\0') {
497 ret2 = rpc_gss_set_svc_name_call(principal,
498 "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);

--- 15 unchanged lines hidden (view full) ---

514 rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2);
515 rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3);
516 rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4);
517 }
518
519 NFSD_LOCK();
520 newnfs_numnfsd--;
521 nfsrvd_init(1);
522 PROC_LOCK(p);
523 p->p_flag2 &= ~P2_AST_SU;
524 PROC_UNLOCK(p);
515 }
516 NFSD_UNLOCK();
517
518out:
519 NFSEXITCODE(error);
520 return (error);
521}
522

--- 29 unchanged lines hidden ---
525 }
526 NFSD_UNLOCK();
527
528out:
529 NFSEXITCODE(error);
530 return (error);
531}
532

--- 29 unchanged lines hidden ---