Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a crash when kill %% and kill %+ are run #35

Merged
merged 1 commit into from
Jun 22, 2020

Conversation

JohnoKing
Copy link

Ksh was trying to use the pw variable as a valid pointer even when it was set to NULL, which is what caused the kill and stop commands to crash when given an invalid job. This is fixed by doing the error check for pw before doing anything else in job_kill.

This bugfix is from Red Hat:
https://git.centos.org/rpms/ksh/blob/44e0a643a93492b1f6beebbf6ffcfd453d9ab8f2/f/SOURCES/ksh-20130214-fixkill.patch

Ksh was trying to use the `pw` variable as a valid pointer even
when it was NULL. This is fixed by doing the error check for
`pw` before doing anything else in `job_kill`.

This bugfix is from Red Hat:
https://git.centos.org/rpms/ksh/blob/44e0a643a93492b1f6beebbf6ffcfd453d9ab8f2/f/SOURCES/ksh-20130214-fixkill.patch

Fixes ksh93#34
@McDutchie McDutchie merged commit 3b14716 into ksh93:master Jun 22, 2020
McDutchie pushed a commit that referenced this pull request Jun 22, 2020
Ksh was trying to use the 'pw' variable as a valid pointer even
when it was NULL. This is fixed by doing the error check for
'pw' before doing anything else in 'job_kill'.

This bugfix is from Red Hat:
https://git.centos.org/rpms/ksh/blob/44e0a643a93492b1f6beebbf6ffcfd453d9ab8f2/f/SOURCES/ksh-20130214-fixkill.patch

Fixes #34
@JohnoKing JohnoKing deleted the fix-kill branch June 23, 2020 00:05
McDutchie added a commit that referenced this pull request Jul 22, 2020
This applies ksh93-jobs.dif from OpenSUSE. Source:
https://build.opensuse.org/package/show/openSUSE:Leap:42.3:Update/ksh

src/cmd/ksh93/sh/jobs.c:
- jog_init(): Save errno in case close(JOBTTY) fails. If cause of
  failure was interruption by a signal (EINTR), repeat close.
- job_kill(): Replace Red Hat fix for #35 with nicer OpenSUSE fix
  that doesn't add a goto before declaring variables. Re: ff358f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants