From 63755f4db82ff8eadaaf0f6a47ffabf9b34ee679 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Florian=20Gamb=C3=B6ck?= Date: Mon, 18 Dec 2017 11:04:05 +0100 Subject: [PATCH] Use pattern matching function 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh index 5c8315580..d39ca1b7d 100755 --- a/modules.d/99fs-lib/fs-lib.sh +++ b/modules.d/99fs-lib/fs-lib.sh @@ -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 -- 2.47.2