summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwahlig <none@none>2006-04-19 09:01:49 -0700
committerjwahlig <none@none>2006-04-19 09:01:49 -0700
commitcbc96f512c30ce7085f61fc32803e50f3dd773c1 (patch)
tree4f6f30d3169ec344c9ea9c0244df6e6cf3dde1fe
parent5dae444307f5b8d786aac2b086e5eb7f18dcf4de (diff)
downloadillumos-joyent-cbc96f512c30ce7085f61fc32803e50f3dd773c1.tar.gz
6404170 rampart adds <sys/cred_impl.h> include to NFS
6412684 client crash dump when attempt to mount the server resource with wrong command
-rw-r--r--usr/src/uts/common/fs/nfs/nfs4_client_secinfo.c15
-rw-r--r--usr/src/uts/common/fs/nfs/nfs4_subr.c3
2 files changed, 10 insertions, 8 deletions
diff --git a/usr/src/uts/common/fs/nfs/nfs4_client_secinfo.c b/usr/src/uts/common/fs/nfs/nfs4_client_secinfo.c
index 862dedd77d..dbdb8f9354 100644
--- a/usr/src/uts/common/fs/nfs/nfs4_client_secinfo.c
+++ b/usr/src/uts/common/fs/nfs/nfs4_client_secinfo.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -841,7 +840,7 @@ nfs4_secinfo_path(mntinfo4_t *mi, cred_t *cr, int isrecov)
{
int error = 0;
- int pathlen;
+ int ncomp;
servinfo4_t *svp = mi->mi_curr_serv;
/*
@@ -849,14 +848,16 @@ nfs4_secinfo_path(mntinfo4_t *mi, cred_t *cr, int isrecov)
*/
(void) nfs_rw_enter_sig(&svp->sv_lock, RW_READER, 0);
ASSERT(svp->sv_path != NULL);
- pathlen = strlen(svp->sv_path);
+
+ /* returns 0 for root, no matter how many leading /'s */
+ ncomp = comp_total(svp->sv_path);
/*
* If mounting server rootdir, use available secinfo list
* on the client. No SECINFO call here since SECINFO op
* expects a component name.
*/
- if (pathlen == 1 && svp->sv_path[0] == '/') {
+ if (ncomp == 0) {
if (svp->sv_secinfo == NULL) {
nfs_rw_exit(&svp->sv_lock);
secinfo_update(svp, secinfo_support);
diff --git a/usr/src/uts/common/fs/nfs/nfs4_subr.c b/usr/src/uts/common/fs/nfs/nfs4_subr.c
index 7c172ba7ce..9278fe03da 100644
--- a/usr/src/uts/common/fs/nfs/nfs4_subr.c
+++ b/usr/src/uts/common/fs/nfs/nfs4_subr.c
@@ -38,7 +38,8 @@
#include <sys/session.h>
#include <sys/thread.h>
#include <sys/dnlc.h>
-#include <sys/cred_impl.h>
+#include <sys/cred.h>
+#include <sys/priv.h>
#include <sys/list.h>
#include <sys/sdt.h>
#include <sys/policy.h>