diff options
author | Harald Hoyer <harald@redhat.com> | 2007-08-14 13:32:33 +0000 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2007-08-14 13:32:33 +0000 |
commit | 34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce (patch) | |
tree | 15c26a89968427a1412775407f4a2754f47dc4d0 /rc.d/rc.sysinit | |
parent | 55979ee4122d9f5d5e5031f2d9b6f14535047171 (diff) | |
download | initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.gz initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.bz2 initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.xz initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.zip |
- added support for cryptsetup-uuids (bug #242078)
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-x | rc.d/rc.sysinit | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 08d84653..75705747 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -119,10 +119,12 @@ init_crypto() { fi if [ -n "$key" -a "x$key" != "xnone" ]; then if test -e "$key" ; then - mode=$(ls -l "$key" | cut -c 5-10) - owner=$(ls -l $key | awk '{ print $3 }') - if [ "$mode" != "------" ] && ! key_is_random "$key"; then - echo $"INSECURE MODE FOR $key" + owner=$(ls -l $key | (read a b owner rest; echo $owner)) + if ! key_is_random "$key"; then + mode=$(ls -l "$key" | cut -c 5-10) + if [ "$mode" != "------" ]; then + echo $"INSECURE MODE FOR $key" + fi fi if [ "$owner" != root ]; then echo $"INSECURE OWNER FOR $key" @@ -139,6 +141,12 @@ init_crypto() { makeswap="" mke2fs="" skip="" + # Parse the src field for UUID= and convert to real device names + if [ "${src%%=*}" == "UUID" ]; then + src=`/sbin/blkid -t "$src" -o device|(read oneline;echo $oneline)` + elif [ "${src/^\/dev\/disk\/by-uuid\/}" != "$src" ]; then + src=$(__readlink $src) + fi # Parse the options field, convert to cryptsetup parameters # and contruct the command line while [ -n "$opt" ]; do |