diff options
author | Alex Elder <elder@dreamhost.com> | 2012-02-02 08:13:30 -0600 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-22 10:47:49 -0500 |
commit | e28fff268e7d40ea7a936478c97ce41b6c22815f (patch) | |
tree | bf228f2fa056b5fcbe41c06b07f960cf8a0cc757 /fs/dcookies.c | |
parent | a725f65e52de73defb3c7033c471c48c56ca6cdd (diff) | |
download | linux-e28fff268e7d40ea7a936478c97ce41b6c22815f.tar.gz linux-e28fff268e7d40ea7a936478c97ce41b6c22815f.tar.bz2 linux-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 'fs/dcookies.c')
0 files changed, 0 insertions, 0 deletions