From cfeda375fd4155a2f8a01717e8733be937fa7a48 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 4 Mar 2013 16:31:50 +0000 Subject: [PATCH] bucoord: restore requires server and partition The VolRestoreCmd sub command requires that the user specifies the server and partition - calls which don't do so won't get past libcmd. Don't check again in the handler that they have been supplied, as it confuses things. Caught by coverity (#985953) Change-Id: Id4548c117b677bd2048744ade8fd91bb15e0e35e Reviewed-on: http://gerrit.openafs.org/9547 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: BuildBot --- src/bucoord/commands.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 48f82e0c8..ba7eb4208 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -1162,21 +1162,17 @@ bc_VolRestoreCmd(struct cmd_syndesc *as, void *arock) } /* specified other destination host */ - if (as->parms[0].items) { - tp = as->parms[0].items->data; - if (bc_ParseHost(tp, &destServ)) { - afs_com_err(whoami, 0, "Failed to locate destination host '%s'", tp); - return -1; - } + tp = as->parms[0].items->data; + if (bc_ParseHost(tp, &destServ)) { + afs_com_err(whoami, 0, "Failed to locate destination host '%s'", tp); + return -1; } /* specified other destination partition */ - if (as->parms[1].items) { - tp = as->parms[1].items->data; - if (bc_GetPartitionID(tp, &destPartition)) { - afs_com_err(whoami, 0, "Can't parse destination partition '%s'", tp); - return -1; - } + tp = as->parms[1].items->data; + if (bc_GetPartitionID(tp, &destPartition)) { + afs_com_err(whoami, 0, "Can't parse destination partition '%s'", tp); + return -1; } for (ti = as->parms[2].items; ti; ti = ti->next) { -- 2.39.5