diff options
author | Jim Ramsay <jim_ramsay@dell.com> | 2012-10-03 09:57:43 -0400 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2012-10-04 17:16:13 -0500 |
commit | 9dd181dcb1ca299cd82075b8e598fc57d87ee1c0 (patch) | |
tree | 30fc3fc70a70aea5885a065989d39da3aa9a1a45 /README | |
parent | 13d08e79090421fbf67fd727aada487ea23ecc2d (diff) | |
download | open-iscsi-9dd181dcb1ca299cd82075b8e598fc57d87ee1c0.tar.gz |
iscsi tools: Convert '-r' argument to an integer before checking if it is a path
If there is a file in the CWD named '1' and you were trying to run
'iscsiadm -m session -r 1 ...', the command would fail with "1 is not a
directory".
Root cause: The code that parses the -r option's argument tries lstat(2)
first, falling back to atoi(3) only if lstat fails.
This change inverts the order of checks, first with strtol(3) to see if
the argument given is a positive integer, then falling back to lstat(2)
only if it is not.
Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions