From c79787845dfc9386d89e821963506d9c90c36677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 22 Jan 2022 23:17:49 +0100 Subject: [PATCH] zpool: get: there's one fewer column than in zfs get MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code allows -o name,property,value,source,name Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #12996 --- cmd/zpool/zpool_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 7142c219c..b680b6c84 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -10106,7 +10106,7 @@ zpool_do_get(int argc, char **argv) { GET_COL_NAME, GET_COL_PROPERTY, GET_COL_VALUE, GET_COL_SOURCE }; - if (i == ZFS_GET_NCOLS) { + if (i == ZFS_GET_NCOLS - 1) { (void) fprintf(stderr, gettext("too " "many fields given to -o " "option\n")); @@ -10133,7 +10133,7 @@ found: memcpy(cb.cb_columns, col_cols, sizeof (col_cols)); - i = ZFS_GET_NCOLS; + i = ZFS_GET_NCOLS - 1; } else cb.cb_columns[i++] = col_cols[c]; }