Skip to content
Tcl Source Code Artifact [f082a97fbe]
Login

Artifact [f082a97fbe]

Artifact f082a97fbe6a2918a4e296ce84592146fdb0dc1b358a682c2a8feae826174a05:

Ticket change [f082a97fbe] - Ticket [7de2d722bd599da5|7de2d722bd] <i>cmdAH-25.2 (Tcl_FileObjCmd: owned) fails on Windows</i> status still Open with 3 other changes by fvogel on 2019-09-10 22:12:36.
D 2019-09-10T22:12:36.651
J icomment <i>>\sIf\sI\sdebug\sthe\stest\s(output\sa\sfile\sname),\sI\ssee\sthe\sfile\sis\spretty\swell\screated\sin\smy\s%TEMP%\sdirectory\sso\sas\sC:/Temp/gorp.file</i>\r\n\r\nFor\sme\sthe\sfile\sis\s\s<code>C:/Users/francois/AppData/Local/Temp/gorp.file</code>\r\nand\s\s<code>echo\s%TEMP%</code>\s\sreturns\s\s<code>C:\\Users\\francois\\AppData\\Local\\Temp</code>.\sSo\syes\sfor\sme\stoo\sthe\sfile\sis\spretty\swell\screated\sin\smy\s%TEMP%\sdirectory.\sA\sdifference\sis\sthat\s%TEMP%\sis\slocated\sin\smy\sWindows\sprofile\s(does\sthis\sreally\smake\sa\sdifference?).\r\n\r\n<i>>\sDo\syou\ssee\s1\sif\syou\sexecute\sboth\sof\sthis\sin\stclsh?\r\n<verbatim>\r\n>\s\sclose\s[open\s[set\sfn\s$::env(TEMP)/test-owner-from-tcl.txt]\sw];\sputs\s[file\sowned\s$fn];\sfile\sdelete\s$fn\r\n>\r\n>\s\sset\sfn\s$::env(TEMP)/test-owner-from-tcl/1.txt;\sfile\smkdir\s[file\sdirname\s$fn];\r\n>\s\sclose\s[open\s$fn\sw];\sputs\s[file\sowned\s$fn];\sfile\sdelete\s-force\s[file\sdirname\s$fn]\r\n</verbatim>\r\n</i>\r\n\r\nActually\sno,\sI\ssee\stwo\szeroes.\r\n\r\n<i>>\sCan\syou\stry\sto\schange\sthe\sowner\susing\stakeown\sif\sabove\smentioned\sscript\sfails\sfor\syou.\sBut\ssomehow\sI'm\spretty\ssure\sexec\stakeown\s/F\s[file\snativename\s$fn]\swould\sfail\sfor\syou.\s</i>\r\n\r\nNope,\sit\sworks.\sI'm\sseeing\s0\sand\s1\swhen\sexecuting\sthe\sfollowing:\r\n\r\n<verbatim>\r\n\s\sclose\s[open\s[set\sfn\s$::env(TEMP)/test-owner-from-tcl.txt]\sw];\sputs\s[file\sowned\s$fn]\r\n\s\sexec\stakeown\s/F\s[file\snativename\s$fn];\sputs\s[file\sowned\s$fn]\r\n</verbatim>\r\n\r\nThis\sis\son\sa\sVista\scomputer\son\swhich\sI'm\slogged\sin\sand\susing\sfrom\san\saccount\s'francois'\shaving\sadministrator\sprivileges.\sBefore\srunning\s<code>takeown</code>,\sthe\sowner\sof\sthe\sfile\sis\smycomputername\\Administrators,\sbut\safter\staking\sownership\sit\sbecomes\smycomputername\\francois.\sUser\s'francois'\shas\sadmin\sprivileges.\r\n\r\nI\sdidnt\syet\scheck\son\sanother\scomputer,\srunning\sWin\s10,\son\swhich\sI'm\slogged\sin\sas\san\sordinary\suser.\sI'm\sseeing\sthe\sproblem\sdescribed\sin\sthe\spresent\sticket\son\sboth\scomputers.\r\n\r\n<i>>\sAlso\snote\sthat\sin\sWindows\s(since\s8.6)\swe\scheck\sownership\susing\sTclWinFileOwned,\swhich\scan\sreturn\s0\sin\scase\sof\sGetNamedSecurityInfo,\sOpenProcessToken\sor\sGetTokenInformation\sfail</i>\r\n\r\nI\shave\salready\sconfirmed\sthat\sTclWinFileOwned\sreturns\sfalse\snot\sbecause\sof\sthe\sabove\sbut\sreally\sbecause\s<code>EqualSid()</>\sreturns\szero\s(see\smy\sfirst\scomment\sbelow\sdated\s2019-09-08\s10:38:11,\sfirst\sline).\sGiven\sthe\sswitch\smade\sby\s<code>takeown</code>\sand\sthe\schange\sof\sresult\sfor\s'file\sowner',\sthis\sis\sall\sconsistent.
J login fvogel
J mimetype text/x-fossil-wiki
K 7de2d722bd599da5db26b42ed8addb16a66c832c
U fvogel
Z b210c6470fb69f9c13373caebc572a06