[parted-devel] [PATCH] parted: Escape printed device path in machine mode

Sebastian Parschauer sparschauer at suse.de
Tue May 8 12:57:47 BST 2018


On 07.05.2018 20:20, Phil Susi wrote:
> On 11/7/2017 3:01 PM, Sebastian Parschauer wrote:
>> The function _print_disk_info() uses the colon ':' as the separator
>> but the device path it prints can contain that character as well.
>> In that case parsing fails.
>> So introduce the function _escape_machine_string() to allocate an
>> output string twice as big as the input string and escape ':' and
>> '\' with a '\'. Print the escaped path and free it again. Ignore
>> the NULL pointer dereference in out-of-memory situation like it
>> is done for the other allocations in _print_disk_info() as well.
> 
> Could you add a NEWS entry and test case?

Thanks for the reply. Sure, will do. This has been noticed with a named
md device causing creation of device name "/dev/md/condor2:0".

This might be fixed by the following submitted patch set already:
"[PATCH 0/3] Test and canonicalize /dev/md/ paths"

Will check. The test for the /dev/md/ paths is included there already
but now I think it is better to split that part off from t6100 and put
it into an own test instead.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/parted-devel/attachments/20180508/4fa84c52/attachment.sig>


More information about the parted-devel mailing list