Deleted Added
full compact
nfs_common.c (54480) nfs_common.c (54485)
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

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
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

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
37 * $FreeBSD: head/sys/nfs/nfs_common.c 54480 1999-12-12 06:09:57Z dillon $
37 * $FreeBSD: head/sys/nfs/nfs_common.c 54485 1999-12-12 07:06:39Z dillon $
38 */
39
40/*
41 * These functions support the macros and help fiddle mbuf chains for
42 * the nfs op functions. They do things like create the rpc header and
43 * copy data between mbuf chains and uio lists.
44 */
45#include <sys/param.h>

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

1969 if (error)
1970 return (error);
1971#ifdef MNT_EXNORESPORT
1972 if (!(exflags & (MNT_EXNORESPORT|MNT_EXPUBLIC))) {
1973 saddr = (struct sockaddr_in *)nam;
1974 if (saddr->sin_family == AF_INET &&
1975 ntohs(saddr->sin_port) >= IPPORT_RESERVED) {
1976 vput(*vpp);
38 */
39
40/*
41 * These functions support the macros and help fiddle mbuf chains for
42 * the nfs op functions. They do things like create the rpc header and
43 * copy data between mbuf chains and uio lists.
44 */
45#include <sys/param.h>

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

1969 if (error)
1970 return (error);
1971#ifdef MNT_EXNORESPORT
1972 if (!(exflags & (MNT_EXNORESPORT|MNT_EXPUBLIC))) {
1973 saddr = (struct sockaddr_in *)nam;
1974 if (saddr->sin_family == AF_INET &&
1975 ntohs(saddr->sin_port) >= IPPORT_RESERVED) {
1976 vput(*vpp);
1977 *vpp = NULL;
1977 return (NFSERR_AUTHERR | AUTH_TOOWEAK);
1978 }
1979 }
1980#endif
1981 /*
1982 * Check/setup credentials.
1983 */
1984 if (exflags & MNT_EXKERB) {
1985 if (!kerbflag) {
1986 vput(*vpp);
1978 return (NFSERR_AUTHERR | AUTH_TOOWEAK);
1979 }
1980 }
1981#endif
1982 /*
1983 * Check/setup credentials.
1984 */
1985 if (exflags & MNT_EXKERB) {
1986 if (!kerbflag) {
1987 vput(*vpp);
1988 *vpp = NULL;
1987 return (NFSERR_AUTHERR | AUTH_TOOWEAK);
1988 }
1989 } else if (kerbflag) {
1990 vput(*vpp);
1989 return (NFSERR_AUTHERR | AUTH_TOOWEAK);
1990 }
1991 } else if (kerbflag) {
1992 vput(*vpp);
1993 *vpp = NULL;
1991 return (NFSERR_AUTHERR | AUTH_TOOWEAK);
1992 } else if (cred->cr_uid == 0 || (exflags & MNT_EXPORTANON)) {
1993 cred->cr_uid = credanon->cr_uid;
1994 for (i = 0; i < credanon->cr_ngroups && i < NGROUPS; i++)
1995 cred->cr_groups[i] = credanon->cr_groups[i];
1996 cred->cr_ngroups = i;
1997 }
1998 if (exflags & MNT_EXRDONLY)

--- 271 unchanged lines hidden ---
1994 return (NFSERR_AUTHERR | AUTH_TOOWEAK);
1995 } else if (cred->cr_uid == 0 || (exflags & MNT_EXPORTANON)) {
1996 cred->cr_uid = credanon->cr_uid;
1997 for (i = 0; i < credanon->cr_ngroups && i < NGROUPS; i++)
1998 cred->cr_groups[i] = credanon->cr_groups[i];
1999 cred->cr_ngroups = i;
2000 }
2001 if (exflags & MNT_EXRDONLY)

--- 271 unchanged lines hidden ---