]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add coverage for #29610
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 19 Oct 2023 14:23:28 +0000 (16:23 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 19 Oct 2023 14:23:28 +0000 (16:23 +0200)
As reproducing it is actually pretty easy, with the benefit of hindsight:

~# systemd-run -P -p MountImages="/this/should/definitely/not/exist.img:/run/img2\:3:nosuid" false
Running as unit: run-u42.service
free(): double free detected in tcache 2

test/units/testsuite-50.sh

index 4142e1ebbc8cea32f5fcddafdabda13b88e1acd4..1a379ee061c94104c323efea97107f829a389adc 100755 (executable)
@@ -674,4 +674,11 @@ if command -v mksquashfs >/dev/null 2>&1; then
     (! test -f /tmp/test-50-confext/etc/waldo )
 fi
 
+# Sneak in a couple of expected-to-fail invocations to cover
+# https://github.com/systemd/systemd/issues/29610
+(! systemd-run -P -p MountImages="/this/should/definitely/not/exist.img:/run/img2\:3:nosuid" false)
+(! systemd-run -P -p ExtensionImages="/this/should/definitely/not/exist.img" false)
+(! systemd-run -P -p RootImage="/this/should/definitely/not/exist.img" false)
+(! systemd-run -P -p ExtensionDirectories="/foo/bar /foo/baz" false)
+
 touch /testok