diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:11:06 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:11:06 +0000 |
commit | a8123060e6717f82ee27efca50c7d2daf4392809 (patch) | |
tree | 3b0b740dd83d6a1244e81e4270497ad8db31a9b7 /plugins/sed | |
parent | Adding debian version 2.8-2. (diff) | |
download | nvme-cli-a8123060e6717f82ee27efca50c7d2daf4392809.tar.xz nvme-cli-a8123060e6717f82ee27efca50c7d2daf4392809.zip |
Merging upstream version 2.9.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/sed')
-rw-r--r-- | plugins/sed/sedopal_cmd.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/plugins/sed/sedopal_cmd.c b/plugins/sed/sedopal_cmd.c index 649e0b2..21ebd36 100644 --- a/plugins/sed/sedopal_cmd.c +++ b/plugins/sed/sedopal_cmd.c @@ -169,8 +169,10 @@ int sedopal_cmd_initialize(int fd) struct opal_key key; struct opal_lr_act lr_act = {}; struct opal_user_lr_setup lr_setup = {}; + struct opal_new_pw new_pw = {}; sedopal_ask_key = true; + sedopal_ask_new_key = true; rc = sedopal_set_key(&key); if (rc != 0) return rc; @@ -217,6 +219,21 @@ int sedopal_cmd_initialize(int fd) return rc; } + /* + * set password + */ + new_pw.new_user_pw.who = OPAL_ADMIN1; + new_pw.new_user_pw.opal_key.lr = 0; + new_pw.session.who = OPAL_ADMIN1; + new_pw.session.sum = 0; + new_pw.session.opal_key.lr = 0; + new_pw.session.opal_key = key; + new_pw.new_user_pw.opal_key = key; + + rc = ioctl(fd, IOC_OPAL_SET_PW, &new_pw); + if (rc != 0) + fprintf(stderr, "Error: failed setting password - %d\n", rc); + return rc; } @@ -455,7 +472,7 @@ int sedopal_cmd_discover(int fd) struct level_0_discovery_features *feat; struct level_0_discovery_features *feat_end; uint16_t code; - uint8_t locking_flags; + uint8_t locking_flags = 0; char buf[4096]; discover.data = (__u64)buf; |