Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321507 - sys-fs/cryptsetup-1.0.6-r2: dm-crypt-start.sh runs post_mount code even if there are no post mount operations
Summary: sys-fs/cryptsetup-1.0.6-r2: dm-crypt-start.sh runs post_mount code even if th...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 22:46 UTC by forums
Modified: 2015-04-12 21:27 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description forums 2010-05-25 22:46:05 UTC
/lib/rcscripts/addons/dm-crypt-start.sh contains the following line in the dm_crypt_execute_localmount() function:
[ -z "$target" ] && [ -z "$post_mount" ] && return

To my understanding while parsing /etc/conf.d/dmcrypt it first checks if there is a target and then if there are post mount instructions. This doesn't make sence since if there IS a target hence $target is NOT empty (-z checks for emptiness) the first statement is false and $post_mount is not checked for emptiness anymore.

This way as long as there is a target ($target is NOT empty) it doesn't matter if post_mount was specified ($post_mount is not empty).

What should be correct is:
[ -z "$target" ] || [ -z "$post_mount" ] && return

In this OR statement return is called if either $target or $post_mount are empty (or both). So in all cases where post_mount does not make any sence.

Reproducible: Always

Steps to Reproduce:
Create a mapping in /etc/conf.d/dmcrypt but don't mount the device in /etc/fstab (includes also the "noauto" option).

Actual Results:  
Shows false warning.

Expected Results:  
No warning.
Comment 1 Michael Weber (RETIRED) gentoo-dev 2010-06-07 23:10:58 UTC
Hello,

please do always try to provide the category/package of a file, when filing a bug report. Is this from sys-fs/cryptsetup-luks or sys-fs/cryptsetup?
Try using `qfile /lib/rcscripts/addons/dm-crypt-start.sh`. And add the version of the package like the output of `emerge -pv sys-fs/cryptsetup-luks` or `emerge -pv sys-fs/cryptsetup`.

Thansk, Michael
Comment 2 forums 2010-06-09 14:33:07 UTC
OK sorry, I forgot the version.

$ qfile /lib/rcscripts/addons/dm-crypt-start.sh
sys-fs/cryptsetup (/lib64/rcscripts/addons/dm-crypt-start.sh)

sys-fs/cryptsetup-1.0.6-r2  USE="nls -dynamic (-selinux)"

Hope this helps
Comment 3 SpanKY gentoo-dev 2015-04-12 21:27:47 UTC
should be all set now in the tree; thanks for the report!

Commit message: Delete old dm_crypt_execute_localmount hook as no one uses it anymore
http://sources.gentoo.org/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc?r1=1.6&r2=1.7