diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 863fc5d..30890cb 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -146,6 +146,10 @@ if [[ "$PATCHNAME" =~ \.patch ]] || [[ "$PATCHNAME" =~ \.diff ]]; then PATCHNAME="${PATCHNAME%.*}" fi +# Only allow alphanumerics and '_' and '-' in the module name. +# Everything else is replaced with '-'. +PATCHNAME=${PATCHNAME//[^a-zA-Z0-9_-]/-} + TEMPDIR="$(mktemp -d /tmp/kpatch-build-XXXXXX)" || die "mktemp failed" trap cleanup EXIT INT TERM