From a3352f08f687e1db4bb20a2f1b1c52bb888b9d97 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 27 Sep 2021 18:26:35 +0200 Subject: [PATCH] dmsetup: fix measure handling Previous patch f853a1bc7afdebb44aeb8c1167e8784d155cad84 enabled ima measurement unconditionally for every status call, but it needs to be set only for 'dmsetup measure' command. --- libdm/dm-tools/dmsetup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c index 4641c1f18..07b6cca8a 100644 --- a/libdm/dm-tools/dmsetup.c +++ b/libdm/dm-tools/dmsetup.c @@ -2446,7 +2446,8 @@ static int _status(CMD_ARGS) if (_switches[NOFLUSH_ARG] && !dm_task_no_flush(dmt)) goto_out; - if (!dm_task_ima_measurement(dmt)) + if (!strcmp(cmd->name, "measure") && + !dm_task_ima_measurement(dmt)) goto_out; if (!_task_run(dmt))