summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2004-07-20 10:12:29 (GMT)
committerdas <das>2004-07-20 10:12:29 (GMT)
commitcbffef93e9ea392a331ffacb04288333ae5475ba (patch)
treee1a25992ef3c631f676418431edca778b7e352b1
parent281500f39ea00f49bce3fd08e71e69b440482c21 (diff)
downloadtcl-cbffef93e9ea392a331ffacb04288333ae5475ba.zip
tcl-cbffef93e9ea392a331ffacb04288333ae5475ba.tar.gz
tcl-cbffef93e9ea392a331ffacb04288333ae5475ba.tar.bz2
* unix/tclUnixFile.c (NativeMatchType): added support for
readonly matching of user immutable files (where available).
-rw-r--r--ChangeLog5
-rw-r--r--unix/tclUnixFile.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 30a5964..a2879a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2004-07-20 Daniel Steffen <das@users.sourceforge.net>
+ * unix/tclUnixFile.c (NativeMatchType): added support for
+ readonly matching of user immutable files (where available).
+
+2004-07-20 Daniel Steffen <das@users.sourceforge.net>
+
* macosx/tclMacOSXBundle.c: dynamically acquire address for
CFBundleOpenBundleResourceMap symbol, since it is only present in
full CoreFoundation on Mac OS X and not in CFLite on pure Darwin.
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index e0f5cf5..07e43fc 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.40 2004/06/18 20:38:02 dgp Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.41 2004/07/20 10:12:29 das Exp $
*/
#include "tclInt.h"
@@ -378,8 +378,12 @@ NativeMatchType(
/*
* readonly means that there are NO write permissions
* (even for user), but execute is OK for anybody
+ * OR that the user immutable flag is set (where supported).
*/
if (((types->perm & TCL_GLOB_PERM_RONLY) &&
+#if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE)
+ !(buf.st_flags & UF_IMMUTABLE) &&
+#endif
(buf.st_mode & (S_IWOTH|S_IWGRP|S_IWUSR))) ||
((types->perm & TCL_GLOB_PERM_R) &&
(access(nativeEntry, R_OK) != 0)) ||