Deleted Added
full compact
nfs_nfsdport.c (283635) nfs_nfsdport.c (291527)
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_nfsdport.c 283635 2015-05-27 22:00:05Z rmacklem $");
35__FBSDID("$FreeBSD: head/sys/fs/nfsserver/nfs_nfsdport.c 291527 2015-11-30 21:54:27Z rmacklem $");
36
37#include <sys/capsicum.h>
38
39/*
40 * Functions that perform the vfs operations required by the routines in
41 * nfsd_serv.c. It is hoped that this change will make the server more
42 * portable.
43 */

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

2644 }
2645
2646 /*
2647 * Now, map the user credentials.
2648 * (Note that ND_AUTHNONE will only be set for an NFSv3
2649 * Fsinfo RPC. If set for anything else, this code might need
2650 * to change.)
2651 */
36
37#include <sys/capsicum.h>
38
39/*
40 * Functions that perform the vfs operations required by the routines in
41 * nfsd_serv.c. It is hoped that this change will make the server more
42 * portable.
43 */

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

2644 }
2645
2646 /*
2647 * Now, map the user credentials.
2648 * (Note that ND_AUTHNONE will only be set for an NFSv3
2649 * Fsinfo RPC. If set for anything else, this code might need
2650 * to change.)
2651 */
2652 if (NFSVNO_EXPORTED(exp) &&
2653 ((!(nd->nd_flag & ND_GSS) && nd->nd_cred->cr_uid == 0) ||
2654 NFSVNO_EXPORTANON(exp) ||
2655 (nd->nd_flag & ND_AUTHNONE))) {
2656 nd->nd_cred->cr_uid = credanon->cr_uid;
2657 nd->nd_cred->cr_gid = credanon->cr_gid;
2658 crsetgroups(nd->nd_cred, credanon->cr_ngroups,
2659 credanon->cr_groups);
2652 if (NFSVNO_EXPORTED(exp)) {
2653 if (((nd->nd_flag & ND_GSS) == 0 && nd->nd_cred->cr_uid == 0) ||
2654 NFSVNO_EXPORTANON(exp) ||
2655 (nd->nd_flag & ND_AUTHNONE) != 0) {
2656 nd->nd_cred->cr_uid = credanon->cr_uid;
2657 nd->nd_cred->cr_gid = credanon->cr_gid;
2658 crsetgroups(nd->nd_cred, credanon->cr_ngroups,
2659 credanon->cr_groups);
2660 } else if ((nd->nd_flag & ND_GSS) == 0) {
2661 /*
2662 * If using AUTH_SYS, call nfsrv_getgrpscred() to see
2663 * if there is a replacement credential with a group
2664 * list set up by "nfsuserd -manage-gids".
2665 * If there is no replacement, nfsrv_getgrpscred()
2666 * simply returns its argument.
2667 */
2668 nd->nd_cred = nfsrv_getgrpscred(nd->nd_cred);
2669 }
2660 }
2661
2662out:
2663 NFSEXITCODE2(error, nd);
2664 return (error);
2665}
2666
2667/*

--- 747 unchanged lines hidden ---
2670 }
2671
2672out:
2673 NFSEXITCODE2(error, nd);
2674 return (error);
2675}
2676
2677/*

--- 747 unchanged lines hidden ---