From: fanyong Date: Thu, 2 Nov 2006 13:44:24 +0000 (+0000) Subject: Small fix, user authentication first. X-Git-Tag: v1_8_0_110~486^2~262 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=257b52a13a5ab0caa98ded4eb14a2ef1628550e2;p=fs%2Flustre-release.git Small fix, user authentication first. --- diff --git a/lustre/mdt/mdt_idmap.c b/lustre/mdt/mdt_idmap.c index e6faf10..c5f346e 100644 --- a/lustre/mdt/mdt_idmap.c +++ b/lustre/mdt/mdt_idmap.c @@ -139,15 +139,16 @@ int mdt_init_idmap(struct mdt_thread_info *info) remote = data->ocd_connect_flags & OBD_CONNECT_RMT_CLIENT; -#if 1 +#if 0 LASSERT(req->rq_auth_uid != INVALID_UID); #else if (req->rq_auth_uid == INVALID_UID) { - CERROR("client %s -> target %s null sec is used!\n", - client, obd->obd_name); + CERROR("client %s -> target %s null sec is used, " + "user not authenticated!\n", client, obd->obd_name); RETURN(-EPERM); } #endif + if (remote) { med->med_rmtclient = 1; if (!req->rq_auth_remote) diff --git a/lustre/mdt/mdt_xattr.c b/lustre/mdt/mdt_xattr.c index c2949db..1e4ed09 100644 --- a/lustre/mdt/mdt_xattr.c +++ b/lustre/mdt/mdt_xattr.c @@ -151,17 +151,17 @@ int mdt_getxattr(struct mdt_thread_info *info) if (reqbody == NULL) RETURN(err_serious(-EFAULT)); + rc = mdt_init_ucred(info, reqbody); + if (rc) + RETURN(rc); + easize = mdt_getxattr_pack_reply(info); if (easize < 0) - RETURN(err_serious(easize)); + GOTO(out, rc = err_serious(easize)); repbody = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY); LASSERT(repbody != NULL); - rc = mdt_init_ucred(info, reqbody); - if (rc) - RETURN(rc); - /* No need further getxattr. */ if (easize == 0 || reqbody->eadatasize == 0) GOTO(out, rc = easize); @@ -282,10 +282,6 @@ int mdt_setxattr(struct mdt_thread_info *info) if (MDT_FAIL_CHECK(OBD_FAIL_MDS_SETXATTR)) RETURN(err_serious(-ENOMEM)); - rc = mdt_setxattr_pack_reply(info); - if (rc < 0) - RETURN(err_serious(rc)); - reqbody = req_capsule_client_get(pill, &RMF_MDT_BODY); if (reqbody == NULL) RETURN(err_serious(-EFAULT)); @@ -294,6 +290,10 @@ int mdt_setxattr(struct mdt_thread_info *info) if (rc) RETURN(rc); + rc = mdt_setxattr_pack_reply(info); + if (rc < 0) + GOTO(out, rc = err_serious(rc)); + /* various sanity check for xattr name */ xattr_name = req_capsule_client_get(pill, &RMF_NAME); if (!xattr_name)