Message ID | 20230721091515.1353371-3-pvorel@suse.cz |
---|---|
State | Accepted |
Headers | show |
Series | Add .skip_in_secureboot flag | expand |
Hi, Printing "Kernel lockdown: %s" instead would make more sense to the user. But that can be fixed during merge. Reviewed-by: Martin Doucha <mdoucha@suse.cz> On 21. 07. 23 11:15, Petr Vorel wrote: > This will be used to simplify .skip_in_lockdown in next commit. > > Suggested-by: Martin Doucha <mdoucha@suse.cz> > Signed-off-by: Petr Vorel <pvorel@suse.cz> > --- > lib/tst_lockdown.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/lib/tst_lockdown.c b/lib/tst_lockdown.c > index 4ce4736c3..8f2ee6762 100644 > --- a/lib/tst_lockdown.c > +++ b/lib/tst_lockdown.c > @@ -47,6 +47,7 @@ int tst_lockdown_enabled(void) > { > char line[BUFSIZ]; > FILE *file; > + int ret; > > if (access(PATH_LOCKDOWN, F_OK) != 0) { > char flag; > @@ -65,5 +66,8 @@ int tst_lockdown_enabled(void) > tst_brk(TBROK | TERRNO, "fgets %s", PATH_LOCKDOWN); > SAFE_FCLOSE(file); > > - return (strstr(line, "[none]") == NULL); > + ret = strstr(line, "[none]") == NULL; > + tst_res(TINFO, "Lockdown: %s", ret ? "on" : "off"); > + > + return ret; > }
Hi Martin, > Hi, > Printing "Kernel lockdown: %s" instead would make more sense to the user. > But that can be fixed during merge. +1, I'll fix that during merge. Kind regards, Petr ... > > + tst_res(TINFO, "Lockdown: %s", ret ? "on" : "off");
Hi Martin, > Hi, > Printing "Kernel lockdown: %s" instead would make more sense to the user. > But that can be fixed during merge. Thanks for all suggestions, fixed and merged. Kind regards, Petr
diff --git a/lib/tst_lockdown.c b/lib/tst_lockdown.c index 4ce4736c3..8f2ee6762 100644 --- a/lib/tst_lockdown.c +++ b/lib/tst_lockdown.c @@ -47,6 +47,7 @@ int tst_lockdown_enabled(void) { char line[BUFSIZ]; FILE *file; + int ret; if (access(PATH_LOCKDOWN, F_OK) != 0) { char flag; @@ -65,5 +66,8 @@ int tst_lockdown_enabled(void) tst_brk(TBROK | TERRNO, "fgets %s", PATH_LOCKDOWN); SAFE_FCLOSE(file); - return (strstr(line, "[none]") == NULL); + ret = strstr(line, "[none]") == NULL; + tst_res(TINFO, "Lockdown: %s", ret ? "on" : "off"); + + return ret; }
This will be used to simplify .skip_in_lockdown in next commit. Suggested-by: Martin Doucha <mdoucha@suse.cz> Signed-off-by: Petr Vorel <pvorel@suse.cz> --- lib/tst_lockdown.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)