summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
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 /unix/tclUnixFile.c
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).
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r--unix/tclUnixFile.c6
1 files changed, 5 insertions, 1 deletions
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)) ||