Whamcloud - gitweb
Small fix, user authentication first.
authorfanyong <fanyong>
Thu, 2 Nov 2006 13:44:24 +0000 (13:44 +0000)
committerfanyong <fanyong>
Thu, 2 Nov 2006 13:44:24 +0000 (13:44 +0000)
lustre/mdt/mdt_idmap.c
lustre/mdt/mdt_xattr.c

index e6faf10..c5f346e 100644 (file)
@@ -139,15 +139,16 @@ int mdt_init_idmap(struct mdt_thread_info *info)
 
         remote = data->ocd_connect_flags & OBD_CONNECT_RMT_CLIENT;
 
 
         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) {
         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
                 RETURN(-EPERM);
         }
 #endif
+
         if (remote) {
                 med->med_rmtclient = 1;
                 if (!req->rq_auth_remote)
         if (remote) {
                 med->med_rmtclient = 1;
                 if (!req->rq_auth_remote)
index c2949db..1e4ed09 100644 (file)
@@ -151,17 +151,17 @@ int mdt_getxattr(struct mdt_thread_info *info)
         if (reqbody == NULL)
                 RETURN(err_serious(-EFAULT));
 
         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)
         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);
 
 
         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);
         /* 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));
 
         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));
         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);
 
         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)
         /* various sanity check for xattr name */
         xattr_name = req_capsule_client_get(pill, &RMF_NAME);
         if (!xattr_name)