summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorMarcel Telka <marcel.telka@nexenta.com>2014-12-17 08:00:52 +0100
committerDan McDonald <danmcd@omniti.com>2014-12-17 11:25:16 -0500
commit9e835c7628dd0e7764a8341a1774a878dc0b024f (patch)
tree90a4903edde735c774f76c5c08460a47fe9ae62d /usr/src
parentebf4a993df0df43f7a5f7a6e512d1df78b9875c0 (diff)
downloadillumos-gate-9e835c7628dd0e7764a8341a1774a878dc0b024f.tar.gz
5440 bad free at checkauth+0x1a2()
Reviewed by: Jan Kryl <jan.kryl@nexenta.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_auth.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/usr/src/uts/common/fs/nfs/nfs_auth.c b/usr/src/uts/common/fs/nfs/nfs_auth.c
index d18c6767fc..638f13e37b 100644
--- a/usr/src/uts/common/fs/nfs/nfs_auth.c
+++ b/usr/src/uts/common/fs/nfs/nfs_auth.c
@@ -1107,6 +1107,27 @@ nfsauth_access(struct exportinfo *exi, struct svc_req *req, cred_t *cr,
int authnone_entry = -1;
/*
+ * By default root is mapped to anonymous user.
+ * This might get overriden later in nfsauth_cache_get().
+ */
+ if (crgetuid(cr) == 0) {
+ if (uid != NULL)
+ *uid = exi->exi_export.ex_anon;
+ if (gid != NULL)
+ *gid = exi->exi_export.ex_anon;
+ } else {
+ if (uid != NULL)
+ *uid = crgetuid(cr);
+ if (gid != NULL)
+ *gid = crgetgid(cr);
+ }
+
+ if (ngids != NULL)
+ *ngids = 0;
+ if (gids != NULL)
+ *gids = NULL;
+
+ /*
* Get the nfs flavor number from xprt.
*/
flavor = (int)(uintptr_t)req->rq_xprt->xp_cookie;
@@ -1142,27 +1163,6 @@ nfsauth_access(struct exportinfo *exi, struct svc_req *req, cred_t *cr,
}
/*
- * By default root is mapped to anonymous user.
- * This might get overriden later in nfsauth_cache_get().
- */
- if (crgetuid(cr) == 0) {
- if (uid != NULL)
- *uid = exi->exi_export.ex_anon;
- if (gid != NULL)
- *gid = exi->exi_export.ex_anon;
- } else {
- if (uid != NULL)
- *uid = crgetuid(cr);
- if (gid != NULL)
- *gid = crgetgid(cr);
- }
-
- if (ngids != NULL)
- *ngids = 0;
- if (gids != NULL)
- *gids = NULL;
-
- /*
* If the flavor is in the ex_secinfo list, but not an explicitly
* shared flavor by the user, it is a result of the nfsv4 server
* namespace setup. We will grant an RO permission similar for