Description of problem: This bug was found by Olaf Hering. Issuing the 'sh' command before mounting any filesystem will cause the daemon to segfault. Version-Release number of selected component (if applicable): libguestfs 1.20.10 libguestfs 1.22.5 libguestfs 1.23.18 How reproducible: 100% Steps to Reproduce: guestfish --ro -v -a /dev/null run : sh "foo" : ls / Actual results: You will see in the debug output that guestfsd has segfaulted. The output will look similar to: guestfsd: error: do_command: you must call 'mount' first to mount the root filesystem *** Error in `guestfsd': free(): invalid pointer: 0x00007fffc1c8d560 *** libguestfs: error: sh: do_command: you must call 'mount' first to mount the root filesystem /init: line 167: 145 Aborted $vg guestfsd Rebooting. (The precise message will differ between versions of libguestfs but it should be obvious that guestfsd has segfaulted) Expected results: guestfsd should return an error and not segfault. Additional info:
Fixed: https://github.com/libguestfs/libguestfs/commit/fc2947b1125aa34b5f04efd2d39cb82b2ebba586