mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-28 22:53:37 +02:00
Do not get 'generation' using ioctl when evm_portable is true
If a signatures is detected as being portable do not attempt to read the generation with the ioctl since in some cases this may not be supported by the filesystem and is also not needed for computing a portable signature. This avoids the current work-around of passing --generation 0 when the ioctl is not supported by the filesystem. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
29c4268764
commit
31f4a22b57
@ -376,7 +376,7 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
|
|||||||
if (mode_str)
|
if (mode_str)
|
||||||
st.st_mode = strtoul(mode_str, NULL, 10);
|
st.st_mode = strtoul(mode_str, NULL, 10);
|
||||||
|
|
||||||
if (!evm_immutable) {
|
if (!evm_immutable && !evm_portable) {
|
||||||
if (S_ISREG(st.st_mode) && !generation_str) {
|
if (S_ISREG(st.st_mode) && !generation_str) {
|
||||||
int fd = open(file, 0);
|
int fd = open(file, 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user