[ksh] add missing patch

Michal Hlavinka mhlavink at fedoraproject.org
Fri Feb 1 17:00:24 UTC 2013


commit 147f917cee9a4ee66be33ec85d6da8676f65ebf7
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Fri Feb 1 18:00:17 2013 +0100

    add missing patch

 ksh-20120801-cdfix2.patch |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/ksh-20120801-cdfix2.patch b/ksh-20120801-cdfix2.patch
new file mode 100644
index 0000000..84bb491
--- /dev/null
+++ b/ksh-20120801-cdfix2.patch
@@ -0,0 +1,25 @@
+diff -up ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c.cdfix2 ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c
+--- ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c.cdfix2	2013-02-01 16:46:50.441771371 +0100
++++ ksh-20120801/src/cmd/ksh93/bltins/cd_pwd.c	2013-02-01 16:57:43.241784024 +0100
+@@ -61,6 +61,7 @@ int sh_diropenat(Shell_t *shp, int dir,
+ {
+ 	int fd,shfd;
+ 	int savederrno=errno;
++	struct stat fs;
+ #ifndef AT_FDCWD
+ 	NOT_USED(dir);
+ #endif
+@@ -133,6 +134,13 @@ int sh_diropenat(Shell_t *shp, int dir,
+ 
+ 	if(fd < 0)
+ 		return fd;
++	
++	if (!fstat(fd, &fs) && !S_ISDIR(fs.st_mode))
++	{
++	  close(fd);
++	  errno = ENOTDIR;
++	  return -1;
++	}
+ 
+ 	/* Move fd to a number > 10 and *register* the fd number with the shell */
+ 	shfd = sh_fcntl(fd, F_dupfd_cloexec, 10);


More information about the scm-commits mailing list