summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorashok <ashok>2016-07-09 11:13:48 (GMT)
committerashok <ashok>2016-07-09 11:13:48 (GMT)
commitd6ae741f7f6ad171b2cc543a32163aed833dd81c (patch)
tree3d67e6cc20a391098bb98a6f2cf76e850dc861e0 /generic
parent48e3873f199817b52d54a4d802966b508917d200 (diff)
downloadtcl-d6ae741f7f6ad171b2cc543a32163aed833dd81c.zip
tcl-d6ae741f7f6ad171b2cc543a32163aed833dd81c.tar.gz
tcl-d6ae741f7f6ad171b2cc543a32163aed833dd81c.tar.bz2
Bugfix [3613671]. file owned implementation for Windows.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdAH.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index a53f1f7..13d3df5 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -12,6 +12,9 @@
*/
#include "tclInt.h"
+#ifdef _WIN32
+# include "tclWinInt.h"
+#endif
#include <locale.h>
/*
@@ -1600,21 +1603,13 @@ FileAttrIsOwnedCmd(
Tcl_WrongNumArgs(interp, 1, objv, "name");
return TCL_ERROR;
}
- if (GetStatBuf(NULL, objv[1], Tcl_FSStat, &buf) == TCL_OK) {
- /*
- * For Windows, there are no user ids associated with a file, so we
- * always return 1.
- *
- * TODO: use GetSecurityInfo to get the real owner of the file and
- * test for equivalence to the current user.
- */
-
#if defined(_WIN32) || defined(__CYGWIN__)
- value = 1;
+ value = TclWinFileOwned(objv[1]);
#else
+ if (GetStatBuf(NULL, objv[1], Tcl_FSStat, &buf) == TCL_OK) {
value = (geteuid() == buf.st_uid);
-#endif
}
+#endif
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(value));
return TCL_OK;
}