sbin/hammer: Don't modify buffer_info for config data for no reason
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Wed, 2 Mar 2016 16:32:15 +0000 (01:32 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 5 Mar 2016 09:43:58 +0000 (18:43 +0900)
commitd604bad632f50ffa1ffd0a470b01825b4b162ab7
tree962663fab7bf125b902839b326eb43b58c5377d3
parent963a61c53638c2a0f89062fe3bd075ad047c44fe
sbin/hammer: Don't modify buffer_info for config data for no reason

print_config() introduced by bc5af92e modifies the data part
of buffer_info via strsep(3). No other part of hammer show
modifies data read from block devices obviously because the
command is supposed to be a read-only command.

Although it's still safe to modify the data part as long as
modified flag isn't set to 1, it's just safer to strdup(3)
the data part before calling print_config(). If someone ever
sets modified flag for some reason, calling print_config()
will break the filesystem.
sbin/hammer/cmd_show.c