[SRU] Honour attributes for local assignments in subshells
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Ubuntu |
Fix Released
|
Undecided
|
Unassigned | ||
| Jammy |
In Progress
|
Undecided
|
Ponnuvel Palaniyappan | ||
| Noble |
Fix Released
|
Undecided
|
Unassigned | ||
| ksh93u+m (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
| Jammy |
Fix Released
|
Medium
|
Ponnuvel Palaniyappan | ||
| Noble |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
[ Impact ]
Any attributes set for local variables aren't exported to subshells correctly, resulting in incorrect behaviour in the subshells.
This is due to a bug in that, the attributes from the parent aren't copied to the subshells and thus not inherited.
[ Test Plan ]
A reproducer:
```bash
#!/bin/ksh
function called_function_ext {
echo "In function_ext: int_typeset_
}
function call_from_main {
typeset -i int_typeset_
export int_typeset_
echo "In call_from_main: int_typeset_
called_
}
call_from_main
```
It outputs:
```
In call_from_main: int_typeset_
In function_ext: int_typeset_
``
Whereas correct output should be:
```
In call_from_main: int_typeset_
In function_ext: int_typeset_
```
[ Where problems could occur ]
Shell's behaviour might be different, or it can't even startup in the worst case.
Potentially attributes might be set incorrectly in the subshells and still exhibit incorrect behaviour.
[ Other Info ]
Upstream bug: https:/
Upstream fix: https:/
PPA with this patch: https:/
This works as expected on Noble which has a new version of ksh that contains this fix.
| Changed in ubuntu: | |
| status: | New → Fix Released |
| description: | updated |
| tags: | added: sts |
| summary: |
- Honour attributes for local assignments in subshells + [SRU} Honour attributes for local assignments in subshells |
| summary: |
- [SRU} Honour attributes for local assignments in subshells + [SRU] Honour attributes for local assignments in subshells |
| description: | updated |
| description: | updated |
| description: | updated |
| description: | updated |
| description: | updated |
| Changed in ksh93u+m (Ubuntu Noble): | |
| status: | New → Fix Released |
| Changed in ksh93u+m (Ubuntu): | |
| status: | New → Fix Released |
| Changed in ksh93u+m (Ubuntu Jammy): | |
| status: | New → Triaged |
| importance: | Undecided → Medium |
| assignee: | nobody → Ponnuvel Palaniyappan (pponnuvel) |
| Changed in ksh93u+m (Ubuntu Jammy): | |
| status: | Incomplete → In Progress |

Attaching debdiff for Jammy.