CR Request for bug:
http://defect.opensolaris.org/bz/show_bug.cgi?id=9841
post_bootroot_pkg_image_mod has incomplete USER_ZLIB_ALG check
Webrev:
http://cr.opensolaris.org/~kemitche/9841/
I fixed the bug as mentioned in the bug description. I also updated the
lines just prior to use the -s flag of /usr/bin/cut so that random
strings don't get perpetuated. Without the -s flag, passing in the
argument "usr_zlib_compression" would get inccorectly passed into
USER_ZLIB_ALG.
Testing:
I performed simple sanity check testing, passing in the following
argslist entries to the post_bootroot_pkg_image_mod:
"usr_zlib_compression=lzma" : Default, valid format. This worked as
expected.
"usr_zlib_compression=" : Empty string for zlib compression. This is
what would have been accepted in the original code as indicated by the
bug text. The code correctly exits with the fix.
"usr_zlib_compression" : No equals sign. In the original code, this
passes the test for USER_ZLIB_KEY, and USER_ZLIB_ALG gets set to
"usr_zlib_compression". This is fixed with the -s flag to /usr/bin/cut.
The code correctly exits now.
"foobar" : Completely invalid. Fails as expected, both before and after
changes.