git: sbin/hammer: Don't modify buffer_info for config data for no reason

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Mar 5 03:54:56 PST 2016


commit d604bad632f50ffa1ffd0a470b01825b4b162ab7
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Mar 3 01:32:15 2016 +0900

    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.

Summary of changes:
 sbin/hammer/cmd_show.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d604bad632f50ffa1ffd0a470b01825b4b162ab7


-- 
DragonFly BSD source repository



More information about the Commits mailing list