Skip to contentSkip to conversation

main - dmsetup: fix measure handling

PATCH Zdenek Kabelac 1 participant 1 message Sep 27, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a3352f08f687e1db4bb20a2f1b1c52bb888b9d97
Commit:        a3352f08f687e1db4bb20a2f1b1c52bb888b9d97
Parent:        e62a71f3dd97795ea64b2f3948dd8629c2dac8b8
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Sep 27 18:26:35 2021 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Sep 27 18:45:25 2021 +0200

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(-)
libdm/dm-tools/dmsetup.c +2 -1
index 4641c1f18..07b6cca8a 100644
@@ -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))