From: anserper Date: Sat, 23 Feb 2008 12:48:55 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_7_0_51~210 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8ede9d29766b1450df64a9c94f45f24175d0817b Branch HEAD b=14852 i=shadow i=adilger added additional checks of id --- diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 419a846..5a58e67 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -96,6 +96,9 @@ static int ost_destroy(struct obd_export *exp, struct ptlrpc_request *req, 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), diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index cd38ad3..0b08358 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -1169,7 +1169,7 @@ int jt_obd_destroy(int argc, char **argv) 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;