Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 525524 - sys-fs/cryptsetup: dmcrypt init.d and handling of nested quotes with source='UUID=...'
Summary: sys-fs/cryptsetup: dmcrypt init.d and handling of nested quotes with source='...
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: 2014-10-15 21:03 UTC by tokiclover
Modified: 2015-04-12 21:44 UTC (History)
0 users

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


Attachments
dmcrypt.rc.patch (dmcrypt.rc.patch,1.67 KB, patch)
2014-10-15 21:04 UTC, tokiclover
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tokiclover 2014-10-15 21:03:10 UTC
I had to figure out and debug why the hell this init script did not work with source='UUID="<uuid>"'. Guess what? it does not work at all. It does work if and and only if the quote marks are removed. Why the hell a user know about it?! You have to check and test it out yourself to know what works.

Common, let's not leave the user in the cold and avoid wasting too much time on how a user should write down a source with a UUID while there is not a single word about it in the config file.

I'm providing a patch which fix this with an additional POSIX compliance for aritmetic evaluation (`$((expression))' is not supported which should be replaced by `$(expr expression)'.)

(God, I don't want to debug such simple basic features. Aand common quoting an UUID is more common that unquoted one when dealing with UUID string.)

Reproducible: Always
Comment 1 tokiclover 2014-10-15 21:04:52 UTC
Created attachment 386744 [details, diff]
dmcrypt.rc.patch
Comment 2 tokiclover 2014-10-15 21:28:15 UTC
I almost forget to mention that my system has sh linked to zsh. This should explain the source of this issue because I'am almost certain that bash, or even (busybox) ash, should remove the quote marks automaticaly. So this is a zsh users issue.

The second part of the patch won't hurt because busybox is bundled as a system package to be able to boot with it and repair a sytem, doesn't it?. Well, it won't never ever work with such aritmetic evaluation.
Comment 3 SpanKY gentoo-dev 2014-10-19 04:33:56 UTC
Comment on attachment 386744 [details, diff]
dmcrypt.rc.patch

your shell is broken if it doesn't support $((...)) for math.  this is POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04

the luksOpen->open change is probably ok now that the latest version takes care of this itself

that means the only issue here is the UUID syntax
Comment 4 SpanKY gentoo-dev 2014-10-19 04:37:23 UTC
Commit message: Move from "luksOpen" to "open" since they are the same and the former is deprecated
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc?r1=1.1&r2=1.2
Comment 5 SpanKY gentoo-dev 2015-04-12 21:44:42 UTC
should be all set now in the tree; thanks for the report!

Commit message: Use blkid -t to look up devices via tag values (like UUID/PARTUUID)
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd?r1=1.6&r2=1.7
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc?r1=1.7&r2=1.8