mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-28 14:43:37 +02:00
ima-evm-utils: sysfs pathname change
Commit 313d21e "tpm: device class for tpm" moved the TPM sysfs location from /sys/class/misc/tpmX/device/ to /sys/class/tpm/tpmX/device/. Mimi Zohar <zohar@linux.vnet.ibm.com>
This commit is contained in:
parent
81010f0d87
commit
c2ef2aabe2
@ -1265,7 +1265,8 @@ static int cmd_ima_clear(struct command *cmd)
|
|||||||
return do_cmd(cmd, ima_clear);
|
return do_cmd(cmd, ima_clear);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *pcrs = "/sys/class/misc/tpm0/device/pcrs";
|
static char *pcrs = "/sys/class/tpm/tpm0/device/pcrs"; /* Kernels >= 4.0 */
|
||||||
|
static char *misc_pcrs = "/sys/class/misc/tpm0/device/pcrs";
|
||||||
|
|
||||||
static int tpm_pcr_read(int idx, uint8_t *pcr, int len)
|
static int tpm_pcr_read(int idx, uint8_t *pcr, int len)
|
||||||
{
|
{
|
||||||
@ -1276,8 +1277,11 @@ static int tpm_pcr_read(int idx, uint8_t *pcr, int len)
|
|||||||
sprintf(pcr_str, "PCR-%d", idx);
|
sprintf(pcr_str, "PCR-%d", idx);
|
||||||
|
|
||||||
fp = fopen(pcrs, "r");
|
fp = fopen(pcrs, "r");
|
||||||
|
if (!fp)
|
||||||
|
fp = fopen(misc_pcrs, "r");
|
||||||
|
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
log_err("Unable to open %s\n", pcrs);
|
log_err("Unable to open %s or %s\n", pcrs, misc_pcrs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user