Admin password check works with yescrypt; shorter Blancco version warning

chpasswd and passwd write yescrypt ($y$) hashes, which the openssl $6$
comparison could not read: every re-run set the pxe password again, and a
box whose password was 'pxe' in yescrypt passed the pxe_admin_password
requirement. Both Admin tasks now compare with crypt(), which handles every
scheme. The config.img warning names the two Blancco versions instead of
the staging guard's merge instructions.
This commit is contained in:
cproudlock
2026-10-17 12:57:25 -04:00
parent c2b0c3d35e
commit 3a8b7cabc7
3 changed files with 38 additions and 26 deletions

View File

@@ -1011,10 +1011,15 @@ def refresh_live_prefs():
ours = f.read()
try:
new = patch_config_img(cfg, ours)
except (StageBlocked, ValueError) as e:
warning = (f"the live config.img (BIOS boot) was not updated: {e} "
except StageBlocked:
live = prefs_version(cpio_member(cfg, "preferences.xml") or b"") or "?"
warning = (f"the live config.img (BIOS boot) is Blancco {live}, older than our "
f"{prefs_version(ours) or '?'} preferences, so it was not updated. "
"Stage a current release on Updates > Blancco releases.")
new = cfg
except ValueError as e:
warning = f"the live config.img (BIOS boot) was not updated: {e}"
new = cfg
if new != cfg:
_atomic_write(cfg_path, new)
changed = True

View File

@@ -190,7 +190,8 @@ class ShareAccounts(Fixture):
with open(os.path.join(BU.blancco_root(), "config.img"), "wb") as f:
f.write(cfg)
done = SA.set_password("blancco", PW)
self.assertTrue(any("WARNING" in d and "config.img" in d for d in done), done)
self.assertTrue(any("WARNING" in d and "config.img (BIOS boot) is Blancco 7.15" in d
and "older than our 7.20" in d for d in done), done)
with open(BP.served_prefs_path(), "rb") as f:
self.assertEqual(self.prefs_share_pw(f.read()), PW)
with open(os.path.join(BU.blancco_root(), "config.img"), "rb") as f: