Whamcloud - gitweb
Branch HEAD
authoranserper <anserper>
Sat, 23 Feb 2008 12:48:55 +0000 (12:48 +0000)
committeranserper <anserper>
Sat, 23 Feb 2008 12:48:55 +0000 (12:48 +0000)
b=14852
i=shadow
i=adilger

added additional checks of id

lustre/ost/ost_handler.c
lustre/utils/obd.c

index 419a846..5a58e67 100644 (file)
@@ -96,6 +96,9 @@ static int ost_destroy(struct obd_export *exp, struct ptlrpc_request *req,
         if (body == NULL)
                 RETURN(-EFAULT);
 
         if (body == NULL)
                 RETURN(-EFAULT);
 
+        if (body->oa.o_id == 0)
+                RETURN(-EPROTO);
+
         if (lustre_msg_buflen(req->rq_reqmsg, REQ_REC_OFF + 1)) {
                 struct ldlm_request *dlm;
                 dlm = lustre_swab_reqbuf(req, REQ_REC_OFF + 1, sizeof(*dlm),
         if (lustre_msg_buflen(req->rq_reqmsg, REQ_REC_OFF + 1)) {
                 struct ldlm_request *dlm;
                 dlm = lustre_swab_reqbuf(req, REQ_REC_OFF + 1, sizeof(*dlm),
index cd38ad3..0b08358 100644 (file)
@@ -1169,7 +1169,7 @@ int jt_obd_destroy(int argc, char **argv)
                 return CMD_HELP;
 
         id = strtoull(argv[1], &end, 0);
                 return CMD_HELP;
 
         id = strtoull(argv[1], &end, 0);
-        if (*end) {
+        if (*end || id == 0 || errno != 0) {
                 fprintf(stderr, "error: %s: invalid objid '%s'\n",
                         jt_cmdname(argv[0]), argv[1]);
                 return CMD_HELP;
                 fprintf(stderr, "error: %s: invalid objid '%s'\n",
                         jt_cmdname(argv[0]), argv[1]);
                 return CMD_HELP;