make security unlock handle special password NULL
Brought to you by:
ideguy
hdparm.c:
... } else if (0 == strcasecmp(name, "security-unlock")) { set_security = 1; security_command = ATA_OP_SECURITY_UNLOCK; get_security_password(0); } else if (0 == strcasecmp(name, "security-set-pass")) { set_security = 1; security_command = ATA_OP_SECURITY_SET_PASS; get_security_password(1); } else if (0 == strcasecmp(name, "security-disable")) { set_security = 1; security_command = ATA_OP_SECURITY_DISABLE; get_security_password(1); } else if (0 == strcasecmp(name, "security-erase")) { set_security = 1; security_command = ATA_OP_SECURITY_ERASE_UNIT; get_security_password(1); } else if (0 == strcasecmp(name, "security-erase-enhanced")) { set_security = 1; enhanced_erase = 1; security_command = ATA_OP_SECURITY_ERASE_UNIT; get_security_password(1); ...
It doesn't seem to make sense that every other commands that convert the password "NULL" to empty but just not security unlock. I assume that it's a typo?
Attached is a patch that change the only get_security_password(0) to get_security_password(1).