Bug 1369571
Summary: | RFC: confusing ksh behavior | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Paulo Andrade <pandrade> | |
Component: | ksh | Assignee: | Siteshwar Vashisht <svashisht> | |
Status: | CLOSED CANTFIX | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 6.8 | CC: | zpytela | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | All | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1460950 (view as bug list) | Environment: | ||
Last Closed: | 2017-06-13 08:50:53 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1460950 |
Description
Paulo Andrade
2016-08-23 19:41:05 UTC
It should be worth noting that this issue does not happen in rhel5 ksh-20100621 where the related diff chunk is: $ diff -u {ksh-20100621,ksh-20120801}/src/cmd/ksh93/bltins/cflow.c @@ -64,7 +64,9 @@ errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); pp->mode = (**argv=='e'?SH_JMPEXIT:SH_JMPFUN); argv += opt_info.index; - n = (((arg= *argv)?(int)strtol(arg, (char**)0, 10)&SH_EXITMASK:shp->oldexit)); + n = (((arg= *argv)?(int)strtol(arg, (char**)0, 10):shp->oldexit)); + if(n<0 || n==256 || n > SH_EXITMASK+shp->gd->sigmax+1) + n &= ((unsigned int)n)&SH_EXITMASK; /* return outside of function, dotscript and profile is exit */ if(shp->fn_depth==0 && shp->dot_depth==0 && !sh_isstate(SH_PROFILE)) pp->mode = SH_JMPEXIT; Unfortunately "blame" on https://github.com/att/ast/blame/master/src/cmd/ksh93/bltins/cflow.c does not help, so I do not know for sure what is the reason of testing for "n==256". But I believe if such test were to be done, it should be "(n&256)". There is no related diff in src/cmd/ksh93/sh/fault.c:sh_done() that is, if the exit value AND 256 is not zero, it will AND it, and "kill itself" with the result. |