Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed62e1e5 authored by Sandeep Patil's avatar Sandeep Patil Committed by Alistair Strachan
Browse files

ANDROID: android-verity: Fix broken parameter handling.



android-verity documentation states that the target expectets
the key, followed by the backing device on the commandline as follows

  "dm=system none ro,0 1 android-verity <public-key-id> <backing-partition>"

However, the code actually expects the backing device as the first
parameter. Fix that.

Bug: 72722987

Change-Id: Ibd56c0220f6003bdfb95aa2d611f787e75a65c97
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent a3c8a097
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -691,16 +691,16 @@ static int android_verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
			handle_error();
			return -EINVAL;
		}
	} else if (argc == 2)
		key_id = argv[1];
	else {
		target_device = argv[0];
	} else if (argc == 2) {
		key_id = argv[0];
		target_device = argv[1];
	} else {
		DMERR("Incorrect number of arguments");
		handle_error();
		return -EINVAL;
	}

	target_device = argv[0];

	dev = name_to_dev_t(target_device);
	if (!dev) {
		DMERR("no dev found for %s", target_device);