xiaolu / mkbootimg_tools

Unpack and repack boot.img,support dtb(dt.img).
530 stars 365 forks source link

Properly escape the cmd_line #12

Closed crpalmer closed 9 years ago

crpalmer commented 9 years ago

Previously img_info was created using double quotes and that allows a lot of shell interpretation that can cause problems. Switch to using ' to avoid most of the shell interpretation (all that is left is '). Make sure that works well by escaping single quotes properly.

For example, the command line:

boo='ya' androidboot.selinux=permissive hi='there'

would be escaped in img_info as

cmd_line='boo='"'"'ya'"'"' androidboot.selinux=permissive hi='"'"'there'"'"''