Description of problem: some guestfish cmds, (like strings, hexdump, strings-e, head-n, tail-n), does not give proper error message when the return msg exceed internal XDR buffer size. Version-Release number of selected component (if applicable): libguestfs-1.0.85-1.fc12.3.x86_64 How reproducible: 100% Steps to Reproduce: 1. run guestfish, add a image, run , mount it 2. run hexdump /your_file, whre "your_file" is a file larger than 900KB or so. Or head-n 100000 /long_file Actual results: error msg:" libguestfs: error: hexdump: guestfsd: failed to encode reply body : Success" Expected results: Should be error msg say "file too large" or "exceed buffer limit" etc ,just like "more/cat" cmd Additional info:
This is fixed in the latest upstream version of libguestfs: $ guestfish -N fs -m /dev/sda1 ><fs> fill-pattern abcdefg 10000000 /test ><fs> strings /test libguestfs: error: strings: guestfsd: failed to encode reply body (maybe the reply exceeds the maximum message size in the protocol?) ><fs> hexdump /test libguestfs: error: hexdump: guestfsd: failed to encode reply body (maybe the reply exceeds the maximum message size in the protocol?) ><fs> head /test libguestfs: error: head: guestfsd: failed to encode reply body (maybe the reply exceeds the maximum message size in the protocol?)
Note that 'hexdump -C' compresses repeated patterns. So to reproduce this, use 'fill-pattern' with a pattern length that doesn't divide 16. For example a pattern length of 2 gives: ><fs> fill-pattern "\xfe\xfd" 900K /foo ><fs> hexdump /foo 00000000 fe fd fe fd fe fd fe fd fe fd fe fd fe fd fe fd |................| * 000e1000 but a pattern length of 3 (3 does not divide 16) gives: ><fs> fill-pattern "\xfe\xfd\xfc" 900K /foo ><fs> hexdump /foo libguestfs: error: hexdump: guestfsd: failed to encode reply body (maybe the reply exceeds the maximum message size in the protocol?)