From d8105d33b0676f0d4918589207b7a893279d7b9f Mon Sep 17 00:00:00 2001 From: suigin Date: Sat, 3 Sep 2016 15:17:50 -0700 Subject: Make crypt.awk work with other awk(1) variants. Change use of the coprocess pipe operator, a GNU extension, to a regular pipe when reading data back from blkid(8). Since we aren't piping data to blkid(8) and then reading it back, we only need a regular pipe and getline here anyway. Without this change, using mawk(1) as the default awk on Void results in failure when parsing /etc/crypttab and dumps us to a rescue shell on boot. --- crypt.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypt.awk b/crypt.awk index d533ab8..f025324 100644 --- a/crypt.awk +++ b/crypt.awk @@ -3,7 +3,7 @@ NF>4 { print "a valid crypttab has max 4 cols not " NF >"/dev/stderr"; next } { # decode the src variants split($2, o_src, "=") - if (o_src[1] == "UUID") "blkid -t " $2 " -l -o device" |& getline src; + if (o_src[1] == "UUID") "blkid -t " $2 " -l -o device" | getline src; else src=o_src[1]; # no password or none is given, ask fo it -- cgit 1.4.1 From d88392e7ec28571c13f10612e55ca3cb9007f350 Mon Sep 17 00:00:00 2001 From: suigin Date: Tue, 20 Sep 2016 08:42:57 -0700 Subject: Updated fix to crypt.awk so that it works with gawk, mawk, and nawk. Furthermore, works with bash, dash or mksh set as the default /bin/sh through xbps-alternatives. --- crypt.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypt.awk b/crypt.awk index f025324..2d2c965 100644 --- a/crypt.awk +++ b/crypt.awk @@ -3,7 +3,7 @@ NF>4 { print "a valid crypttab has max 4 cols not " NF >"/dev/stderr"; next } { # decode the src variants split($2, o_src, "=") - if (o_src[1] == "UUID") "blkid -t " $2 " -l -o device" | getline src; + if (o_src[1] == "UUID") ("blkid -l -o device -t " $2) | getline src; else src=o_src[1]; # no password or none is given, ask fo it -- cgit 1.4.1