]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Use pattern matching function 334/head
authorFlorian Gamböck <mail@floga.de>
Mon, 18 Dec 2017 10:04:05 +0000 (11:04 +0100)
committerFlorian Gamböck <mail@floga.de>
Mon, 18 Dec 2017 10:04:05 +0000 (11:04 +0100)
The needle argument in this specific case is a pattern, which cannot be
matched by the "literal" string matcher strstr.

This can result in fsck calls like:

    e2fsck -a -y /dev/sda1

Which will then exit with an error like:

    e2fsck: Only one of the options -p/-a, -n or -y may be specified.

Hence, it is necessary to use the strglobin function to correctly match
the pattern.

modules.d/99fs-lib/fs-lib.sh

index 5c83155808ef537e7526baa289d2c1bda9713d98..d39ca1b7da0835904f656adcd9f655f43c5cfffa 100755 (executable)
@@ -100,7 +100,7 @@ fsck_drv_com() {
     local _ret
     local _out
 
-    if ! strstr "$_fop" "-[ynap]"; then
+    if ! strglobin "$_fop" "-[ynap]"; then
         _fop="-a ${_fop}"
     fi