Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 426986 - sys-fs/cryptsetup: initscript ignores last line of config file when missing final newline
Summary: sys-fs/cryptsetup: initscript ignores last line of config file when missing f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-17 12:04 UTC by klamp
Modified: 2015-04-12 20:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Example config files (dmcrypt.tar.gz,218 bytes, text/plain)
2013-01-18 08:03 UTC, klamp
Details
Example config files (dmcrypt.tar.gz,218 bytes, application/octet-stream)
2013-01-18 08:16 UTC, klamp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description klamp 2012-07-17 12:04:29 UTC
/etc/init.d/dmcrypt script ignores lines of /etc/conf.d/dmcrypt that are not terminated with newline character = last line. I think so such behavior should be either removed, or user should be explicitly warned about it, at place where he will most likely encounter it - end of preinstalled /etc/conf.d/dmcrypt file.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-01-17 23:26:12 UTC
I don't follow, please provide an example that triggers the problem.
Comment 2 klamp 2013-01-18 08:03:49 UTC
Created attachment 336012 [details]
Example config files

dmcrypt.ok works as expected, dmcrypt.bad does not.
Comment 3 klamp 2013-01-18 08:16:46 UTC
Created attachment 336014 [details]
Example config files

Output with dmcrypt.ok:

desktop conf.d # /etc/init.d/dmcrypt restart
 * Removing dm-crypt mappings
 *   crypt-home ...
Device crypt-home is not active. [ !! ]
 * Setting up dm-crypt mappings ...
 * /dev/sda1 will not be decrypted ...
 * Reason: keyfile /full/path/to/homekey does not exist. 

Output with dmcrypt.bad:

desktop conf.d # /etc/init.d/dmcrypt restart
 * Removing dm-crypt mappings
 *   crypt-home ...
Device crypt-home is not active. [ !! ]
 * Setting up dm-crypt mappings ...
 *   crypt-home using:   create crypt-home /dev/sda1 ...
Enter passphrase:

Lack of new-line character after line "key='/full/path/to/homekey'" causes it to be ignored and passphrase being implicitly used.
Comment 4 SpanKY gentoo-dev 2015-04-12 20:32:48 UTC
should be all set now in the tree; thanks for the report!

Commit message: Note that the config file must be terminated by a newline
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd?r1=1.5&r2=1.6