Whamcloud - gitweb
LU-13117 libcfs: fix to match right key in cfs_get_environ() 96/37396/2
authorWang Shilong <wshilong@ddn.com>
Wed, 8 Jan 2020 01:45:27 +0000 (09:45 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 06:15:04 +0000 (06:15 +0000)
commita9f62388faa08610e855e6c5a59b853b9f17ccd3
tree1cf9a60600abccca2c0a373e9b29251dbdb7d677
parent70a42ae7880e137267dcb0dc00b4a38fbae0fe37
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.

Lustre-change: https://review.whamcloud.com/37156
Lustre-commit: 31170f9ceca91684ea66e0b16757881563a8cf26

Test-Parameters: trivial
Change-Id: Ia2b4ccd1f10c89059cecc224d4e2ba8d1d75b825
Signed-off-by: Wang Shilong <wshilong@ddn.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>
Reviewed-on: https://review.whamcloud.com/37396
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
libcfs/libcfs/linux/linux-curproc.c
lustre/tests/sanity.sh