Bug 981683

Summary: "hivex-commit" should fail with a relative path
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acathrow, bfan, leiwang, mbooth, qguan, wshi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 980372 Environment:
Last Closed: 2013-07-05 14:09:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 905322, 980372    

Description Richard W.M. Jones 2013-07-05 13:17:28 UTC
+++ This bug was initially created as a clone of Bug #980372 +++

+++ This bug was initially created as a clone of Bug #905322 +++

Test script.  You will need 'minimal' from
https://github.com/libguestfs/hivex/blob/master/images/minimal
and note that you have to uncomment only *one* of the three hivex-commit
lines in the script.

guestfish -x -N fs -m /dev/sda1 <<EOF
upload /mnt/scratch/minimal /minimal
hivex-open /minimal write:true
#hivex-commit ""
#hivex-commit "/minimal"
hivex-commit "minimal"
EOF

The first case (NULL) should always succeed and it does.

The second case (absolute path "/minimal") should succeed
and it does.

The third case (relative path "minimal") should fail because
relative paths shouldn't be allowed.  It doesn't fail, so that is
a bug.

Tested on libguestfs-1.23.7-1.fc20.x86_64