aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@dreamhost.com>2012-02-02 08:13:30 -0600
committerAlex Elder <elder@dreamhost.com>2012-03-22 10:47:49 -0500
commite28fff268e7d40ea7a936478c97ce41b6c22815f (patch)
treebf228f2fa056b5fcbe41c06b07f960cf8a0cc757 /drivers/block/brd.c
parentrbd: encapsulate argument parsing for rbd_add() (diff)
downloadlinux-dev-e28fff268e7d40ea7a936478c97ce41b6c22815f.tar.xz
linux-dev-e28fff268e7d40ea7a936478c97ce41b6c22815f.zip
rbd: don't use sscanf() in rbd_add_parse_args()
Make use of a few simple helper routines to parse the arguments rather than sscanf(). This will treat both missing and too-long arguments as invalid input (rather than silently truncating the input in the too-long case). In time this can also be used by rbd_add() to use the passed-in buffer in place, rather than copying its contents into new buffers. It appears to me that the sscanf() previously used would not correctly handle a supplied snapshot--the two final "%s" conversion specifications were not separated by a space, and I'm not sure how sscanf() handles that situation. It may not be well-defined. So that may be a bug this change fixes (but I didn't verify that). The sizes of the mon_addrs and options buffers are now passed to rbd_add_parse_args(), so they can be supplied to copy_token(). Signed-off-by: Alex Elder <elder@dreamhost.com>
Diffstat (limited to 'drivers/block/brd.c')
0 files changed, 0 insertions, 0 deletions