Whamcloud - gitweb
LU-13117 libcfs: fix to match right key in cfs_get_environ() 56/37156/4
authorWang Shilong <wshilong@ddn.com>
Wed, 8 Jan 2020 01:45:27 +0000 (09:45 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 23 Jan 2020 05:31:55 +0000 (05:31 +0000)
commit31170f9ceca91684ea66e0b16757881563a8cf26
treecb7f61a0a122b1ad13d51415a9cb63ac03eba030
parent7aa58847b94d0ebb2796774a2de2183ba7f8cc4b
LU-13117 libcfs: fix to match right key in cfs_get_environ()

It does the memcmp() to match the environment variable
with the desired key, then accounts for the "=" when
calculating length. But it fails to check that the next
character is actually an equals sign. In the case of
any key which is also the prefix to some other variable

Also add debug information for debugging similar issue
in the future.

Test-Parameters: trivial
Change-Id: Ia2b4ccd1f10c89059cecc224d4e2ba8d1d75b825
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/37156
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/linux/linux-curproc.c
lustre/tests/sanity.sh