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>
pull/51938/head
Sven Wegener 6 years ago committed by John R Barker
parent 8724c0deda
commit a966662e9a

@ -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)

Loading…
Cancel
Save