Skip to content

Commit

Permalink
Merge pull request #18303 from yuwata/verity-cleanup
Browse files Browse the repository at this point in the history
veritysetup-generator: drop unused struct and variable
  • Loading branch information
yuwata committed Jan 19, 2021
2 parents 7e2757c + 13a4e9f commit 29d65a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion TODO
Expand Up @@ -21,7 +21,7 @@ Janitorial Clean-ups:
Features:

* sd-boot: define a drop-in dir in the ESP that may contain X.509
certificates. If the firmware is detected to be in setup mode, automaticallly
certificates. If the firmware is detected to be in setup mode, automatically
enroll them as PK/KEK/db, turn off setup mode and proceed. Optionally,
instead of auto-enrolling them add them to the sd-boot menu, giving the user
the option to manually enroll them, after selecting the menu entry. This way,
Expand Down
20 changes: 2 additions & 18 deletions src/veritysetup/veritysetup-generator.c
Expand Up @@ -7,7 +7,6 @@
#include <unistd.h>

#include "alloc-util.h"
#include "dropin.h"
#include "fd-util.h"
#include "fileio.h"
#include "fstab-util.h"
Expand All @@ -25,16 +24,6 @@

#define SYSTEMD_VERITYSETUP_SERVICE "systemd-veritysetup@root.service"

typedef struct verity_device {
char *uuid;
char *datadev;
char *hashdev;
char *roothash;
char *name;
char *options;
bool create;
} verity_device;

static const char *arg_dest = NULL;
static bool arg_enabled = true;
static bool arg_read_veritytab = true;
Expand Down Expand Up @@ -395,9 +384,7 @@ static int add_veritytab_devices(void) {
for (;;) {
_cleanup_free_ char *line = NULL, *name = NULL, *data_device = NULL, *hash_device = NULL,
*roothash = NULL, *options = NULL;
verity_device *d = NULL;
char *l, *data_uuid, *hash_uuid;
int k;

r = read_line(f, LONG_LINE_MAX, &line);
if (r < 0)
Expand All @@ -411,8 +398,8 @@ static int add_veritytab_devices(void) {
if (IN_SET(l[0], 0, '#'))
continue;

k = sscanf(l, "%ms %ms %ms %ms %ms", &name, &data_device, &hash_device, &roothash, &options);
if (k < 4 || k > 5) {
r = sscanf(l, "%ms %ms %ms %ms %ms", &name, &data_device, &hash_device, &roothash, &options);
if (!IN_SET(r, 4, 5)) {
log_error("Failed to parse %s:%u, ignoring.", arg_veritytab, veritytab_line);
continue;
}
Expand All @@ -433,9 +420,6 @@ static int add_veritytab_devices(void) {
arg_veritytab);
if (r < 0)
return r;

if (d)
d->create = false;
}

return 0;
Expand Down

0 comments on commit 29d65a4

Please sign in to comment.