summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--unix/tclUnixFile.c9
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 31c672a..3a22e8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * unix/tclUnixFile.c (TclpMatchInDirectory): Argument to access()
+ was entryPtr->d_name instead of nativeEntry which failed when
+ trying to check access for files in other than the current
+ directory. [Bug 475941, reported by Georgios Petasis]
+
2001-10-25 Donal K. Fellows <fellowsd@cs.man.ac.uk>
* unix/tclUnixChan.c: Added stateUpdated member to struct TtyState.
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index befa699..d78dca4 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.13 2001/10/29 14:25:03 dkf Exp $
*/
#include "tclInt.h"
@@ -301,7 +301,6 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
if (entryPtr == NULL) {
break;
}
-
if (types != NULL && (types->perm & TCL_GLOB_PERM_HIDDEN)) {
/*
* We explicitly asked for hidden files, so turn around
@@ -365,11 +364,11 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
((types->perm & TCL_GLOB_PERM_RONLY) &&
(buf.st_mode & (S_IWOTH|S_IWGRP|S_IWUSR))) ||
((types->perm & TCL_GLOB_PERM_R) &&
- (access(entryPtr->d_name, R_OK) != 0)) ||
+ (access(nativeEntry, R_OK) != 0)) ||
((types->perm & TCL_GLOB_PERM_W) &&
- (access(entryPtr->d_name, W_OK) != 0)) ||
+ (access(nativeEntry, W_OK) != 0)) ||
((types->perm & TCL_GLOB_PERM_X) &&
- (access(entryPtr->d_name, X_OK) != 0))
+ (access(nativeEntry, X_OK) != 0))
)) {
typeOk = 0;
}