crypttab: Trim trailing newlines (#51594)

Having a comment or an empty line in /etc/crypttab results in an
additional empty line being added, because the newline that is part of
the line being read is getting re-injected in addition to the newline
used to concatenate the lines.

Signed-off-by: Sven Wegener <sven.wegener@inovex.de>
This commit is contained in:
Sven Wegener 2019-02-22 10:25:23 +01:00 committed by John R Barker
parent 8724c0deda
commit a966662e9a

View file

@ -218,6 +218,7 @@ class Line(object):
self.opts = Options(opts)
if line is not None:
self.line = self.line.rstrip('\n')
if self._line_valid(line):
self.name, backing_device, password, opts = self._split_line(line)