| Summary: | sys-fs/cryptsetup - bashisms in /etc/init.d/dmcrypt | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Alexander Tsoy <alexander> |
| Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | bruce, bugs+gentoo, gentoobugs, jackdachef, mark.morschhaeuser, toralf |
| Priority: | Normal | Keywords: | PATCH |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | dmcrypt-posix.patch | ||
Created attachment 342852 [details, diff]
dmcrypt-posix.patch
(In reply to comment #0) > And I'm not sure how to deal with "read -u" You would use something like "while read <&3 targetline ; do". I have made changes suggested by you/checkbashisms (see attached patch) but for whatever reason both /bin/dash and /bin/bb still balk ... though with the same changes /bin/bash has no issues whatsoever (go figure). The only other reason I can see is 'local' but both dash and bb have this as a builtin (though its possible they handle it differently). It would be nice to have either bb or dash as /bin/sh but currently I'm too busy to fiddle with it. best ... khay *** Bug 484728 has been marked as a duplicate of this bug. *** (In reply to Khayyam from comment #2) > but for whatever > reason both /bin/dash and /bin/bb still balk ... Your patch is working fine with mksh. Thanks! *** Bug 523864 has been marked as a duplicate of this bug. *** I confirm that the patch works also for dash. works for me too, with app-shells/dash-0.5.7.4 should be all set now in the tree; thanks for the report! Commit message: Fix bashisms in init script http://sources.gentoo.org/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc?r1=1.2&r2=1.3 |
Please remove bashisms from dmcrypt initscript. ${key/*:/} is probably equivalent to ${key##*:}. "type" is an XSI POSIX extension, but probably could be replaced by "command -v". And I'm not sure how to deal with "read -u". * QA Notice: shell script appears to use non-POSIX feature(s): * possible bashism in /etc/init.d/dmcrypt line 99 (${parm/?/pat[/str]}): * mode=${key/*:/} && ( [ "${mode}" = "${key}" ] || [ -z "${mode}" ] ) && mode=reg * possible bashism in /etc/init.d/dmcrypt line 100 (${parm/?/pat[/str]}): * key=${key/:*/} * possible bashism in /etc/init.d/dmcrypt line 158 (type): * if type -p gpg >/dev/null ; then * possible bashism in /etc/init.d/dmcrypt line 258 (read with option other than -r): * while read -u 3 targetline ; do Reproducible: Always