From: David Tardon Date: Thu, 30 May 2024 08:46:13 +0000 (+0200) Subject: cryptsetup-generator: continue parsing after error X-Git-Tag: v257-rc1~1175^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83813bae7ae471862ff84b038b5e4eaefae41c98;p=thirdparty%2Fsystemd.git cryptsetup-generator: continue parsing after error Let's make the crypttab parser more robust and continue even if parsing of a line failed. --- diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index d8065d8b93c..6016e7580b8 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -844,7 +844,7 @@ static int add_crypttab_device(const char *name, const char *device, const char static int add_crypttab_devices(void) { _cleanup_fclose_ FILE *f = NULL; unsigned crypttab_line = 0; - int r; + int r, ret = 0; if (!arg_read_crypttab) return 0; @@ -877,12 +877,10 @@ static int add_crypttab_devices(void) { continue; } - r = add_crypttab_device(name, device, keyspec, options); - if (r < 0) - return r; + RET_GATHER(ret, add_crypttab_device(name, device, keyspec, options)); } - return 0; + return ret; } static int add_proc_cmdline_devices(void) {