cd builtin file descriptor operations messed with IO redirections (#1133586)

This commit is contained in:
Michal Hlavinka 2014-08-26 15:56:21 +02:00
parent b3ac32f991
commit 5b24864bf9
2 changed files with 21 additions and 1 deletions

15
ksh-20130613-cdfix4.patch Normal file
View File

@ -0,0 +1,15 @@
diff -up ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c.cdfix4 ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c
--- ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c.cdfix4 2014-08-26 15:24:57.276953822 +0200
+++ ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c 2014-08-26 15:25:34.738770361 +0200
@@ -143,9 +143,9 @@ int sh_diropenat(Shell_t *shp, int dir,
}
/* Move fd to a number > 10 and *register* the fd number with the shell */
- shfd = sh_fcntl(fd, F_dupfd_cloexec, 10);
+ shfd = fcntl(fd, F_dupfd_cloexec, 10);
savederrno=errno;
- sh_close(fd);
+ close(fd);
errno=savederrno;
return(shfd);
}

View File

@ -9,7 +9,7 @@ Group: System Environment/Shells
#CPL everywhere else (for KSH itself)
License: CPL
Version: %{releasedate}
Release: 20%{?dist}
Release: 21%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{release_date}.tgz
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{release_date}.tgz
Source2: kshcomp.conf
@ -118,6 +118,7 @@ Patch49: ksh-20120801-cdfix3.patch
# sent upstream, rhbz#1116506
Patch50: ksh-20120801-locking.patch
Patch100: ksh-20130613-cdfix4.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Conflicts: pdksh
@ -173,6 +174,7 @@ with "sh" (the Bourne Shell).
%patch48 -p1 -b .fununset
%patch49 -p1 -b .cdfix3
%patch50 -p1 -b .locking
%patch100 -p1 -b .cdfix4
#/dev/fd test does not work because of mock
sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
@ -273,6 +275,9 @@ fi
rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Aug 26 2014 Michal Hlavinka <mhlavink@redhat.com> - 20120801-21
- cd builtin file descriptor operations messed with IO redirections (#1133586)
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20120801-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild