mirror of
https://github.com/systemd/systemd
synced 2024-07-21 02:05:05 +00:00
cryptsetup-generator: continue parsing after error
Let's make the crypttab parser more robust and continue even if parsing of a line failed.
This commit is contained in:
parent
a07cb7d404
commit
83813bae7a
|
@ -844,7 +844,7 @@ static int add_crypttab_device(const char *name, const char *device, const char
|
||||||
static int add_crypttab_devices(void) {
|
static int add_crypttab_devices(void) {
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
unsigned crypttab_line = 0;
|
unsigned crypttab_line = 0;
|
||||||
int r;
|
int r, ret = 0;
|
||||||
|
|
||||||
if (!arg_read_crypttab)
|
if (!arg_read_crypttab)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -877,12 +877,10 @@ static int add_crypttab_devices(void) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = add_crypttab_device(name, device, keyspec, options);
|
RET_GATHER(ret, add_crypttab_device(name, device, keyspec, options));
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int add_proc_cmdline_devices(void) {
|
static int add_proc_cmdline_devices(void) {
|
||||||
|
|
Loading…
Reference in a new issue