Commit 54eefbca authored by chrfranke's avatar chrfranke
Browse files

ataprint.cpp: Print Master Password ID if set to non-default value.

git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk@5384 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 546e73f8
$Id$
2022-05-22 Christian Franke <franke@computer.org>
ataprint.cpp: Print Master Password ID if set to non-default value.
2022-05-22 Eaton Zveare <eaton@eaton-works.com>
ataprint.cpp: Add master_password_id to ata_security json output
......
......@@ -4,7 +4,7 @@
* Home page of code is: https://www.smartmontools.org
*
* Copyright (C) 2002-11 Bruce Allen
* Copyright (C) 2008-21 Christian Franke
* Copyright (C) 2008-22 Christian Franke
* Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
......@@ -3277,7 +3277,13 @@ static void print_ata_security_status(const char * msg, unsigned short state, un
}
}
jout("%s%s%s%s%s\n", msg, s1, s2, s3, s4);
// Print Master Password ID if set to non-default value
// (0x0000, 0xffff: unsupported, 0xfffe: default)
char s5[32] = "";
if (0x0000 < master_password_id && master_password_id < 0xfffe)
snprintf(s5, sizeof(s5), ", Master PW ID: 0x%04x", master_password_id);
jout("%s%s%s%s%s%s\n", msg, s1, s2, s3, s4, s5);
json::ref jref = jglb["ata_security"];
jref["state"] = state;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment