[Bug 1692420] Comment bridged from LTC Bugzilla
bugproxy
bugproxy at us.ibm.com
Fri Jan 5 21:00:10 UTC 2018
------- Comment From tyreld at us.ibm.com 2018-01-05 15:55 EDT-------
(In reply to comment #58)
> While I see that the commit did have the change to lsdevinfo around line 276
> it looks like it somehow got reverted as trunk shows it still using cat.
>
> https://github.com/ibm-power-utilities/powerpc-utils/blob/master/scripts/
> lsdevinfo#L276
Actually, Seeteena's patch only touched two places in the lsdevinfo
script. Another patch hunk went in several months later that shifted the
original line numbers, and is exposing to us that their are two other
places in the script that use cat that weren't fixed. Namely, for PCI
ethernet devices, and VFC devices.
[tyreld at oc6857751186 powerpc-utils]$ git blame scripts/lsdevinfo | grep "$dev/ibm,loc-code"
74715cc0 (Nathan Fontenot 2017-05-22 16:40:58 -0400 233) physloc=$(tr -d '\0' < $dev/ibm,loc-code)
4fcc611a (Seeteena Thoufeek 2017-01-11 15:36:33 +0530 254) physloc=$(tr -d '\0' < $dev/ibm,loc-code)
c600f291 (Santiago Leon 2012-04-16 08:49:18 -0500 276) physloc=$($CAT $dev/ibm,loc-code)
4fcc611a (Seeteena Thoufeek 2017-01-11 15:36:33 +0530 296) physloc=$(tr -d '\0' < $dev/ibm,loc-code)
8a8ff90e (Santiago Leon 2009-09-21 14:16:35 -0500 441) physloc=$(cat $dev/ibm,loc-code)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to powerpc-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1692420
Title:
[SRU] powerpc-utils commands exhibits "command substitution: ignored
null byte in input" warning message
Status in The Ubuntu-power-systems project:
Fix Committed
Status in powerpc-utils package in Ubuntu:
Fix Released
Status in powerpc-utils source package in Zesty:
Fix Committed
Bug description:
[Impact]
The current version of powerpc-utils in Ubuntu Zesty and Artful
carries a bug exposed by bash 4.4+ which causes a warning to be logged
to stderr in 4 different commands: ls-veth, ls-vscsi, lsdevinfo, and
ofpathname. Bash is unable to store the NUL bytes in the result of a
command substitution, prior to 4.4 it silently dropped the NUL bytes,
but since 4.4 it drops the NUL bytes with a warning: "command
substitution: ignored null byte in input".
Additionally to that the ofpathname command also had a bug that caused
a "cd: too many arguments" warning.
Upstream has fixed both [1] and they now need to be backport to Zesty.
[Test Case 1]
Call any of the affected commands without arguments, they should
output "command substitution: ignored null byte in input" to stderr.
The same warning can easily be reproduced in bash 4.4+ by executing:
$ x=$(cat < /proc/$$/cmdline)
bash: warning: command substitution: ignored null byte in input
And to fix it:
$ x=$(tr -d '\0' < /proc/$$/cmdline)
<no output, as expected>
[Test Case 2]
Call ofpathname with no arguments:
$ ofpathname
cd: too many arguments
[Regression Potential]
The replacement of 'cat' with 'tr -d "\0"' causes no regression. Also,
both commands are part of coreutils.
The 'cd' fix replaces it with a drop_dir call. In case the requested
path is not found then the previous behavior would be kept (ie. no
directory change).
[Other Info]
Upstream fix link:
[1] https://github.com/ibm-power-utilities/powerpc-utils/commit/4fcc611a09caea70e6bca6a1275211c72ac4bb45
[Old description]
Please cherry pick...
https://github.com/ibm-power-utilities/powerpc-
utils/commit/4fcc611a09caea70e6bca6a1275211c72ac4bb45
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-power-systems/+bug/1692420/+subscriptions
More information about the foundations-bugs
mailing list