.
D 2015-11-23T09:50:11.874
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment The\sdocumented\sbehavior\sof\s'file\scopy'\sis\s"When\scopying\swithin\sa\ssingle\sfilesystem,\sfile\scopy\swill\scopy\ssoft\slinks\s(i.e.\sthe\slinks\sthemselves\sare\scopied,\snot\sthe\sthings\sthey\spoint\sto)."\s\sOn\sWindows\s'file\scopy'\sfails\sto\scopy\ssymlink\sdirectories,\sand\scopies\sthe\scontent\s(not\sthe\slink)\sof\ssymlink\sfiles.\r\n\r\nNote:\sI\sam\stalking\sabout\sSymbolic\sLinks\s(https://msdn.microsoft.com/en-us/library/windows/desktop/aa365680(v=vs.85).aspx);\snot\sHard\sLinks,\sJunctions,\sor\sShortcuts\s(.lnk).\r\n\r\nSummary:\r\n-\sfile\scopy\sfile-symlink\sdest\s->\scopies\scontent\r\n-\sfile\scopy\sdir-symlink\sdest\s->\sillegal\soperation\son\sa\sdirectory\r\n-\sfile\scopy\sdir-containing-file-symlink\sdest\s->\spermission\sdenied\r\n-\sfile\scopy\sdir-containing-dir-symlink\sdest\s->\spermission\sdenied\r\n\r\nExpected\sbehavior:\r\n-\sCopy\ssymlinks\sas\sdocumented\sin\sthe\sman\spage\r\n\r\nEnvironment:\r\n-\sWindows\s7\sEnterprise,\s64-bit\son\sIntel\r\n-\sNTFS\s('fsutil\sfsinfo\sntfsinfo\sc:'\sidentifies\sversion\s3.1)\r\n-\stcl_patchLevel\s=\s8.6.2\r\n\r\nSteps\sto\sreproduce:\r\n\r\n1.\sOpen\sa\scommand\sprompt\susing\s"Run\sAs\sAdministrator"\s(elevated\sprivileges\sare\srequired\sto\screate\sa\ssymlink)\r\n2.\sIn\sa\snew\sfolder:\r\n\s\s2.a.\sCreate\sa\sfolder\s'res'\s:\smkdir\sres\r\n\s\s2.b.\sIn\s'res'\screate\sa\sfile\s'foo.txt'\s:\secho\sHello\s>\sres\\foo.txt\r\n\s\s2.c.\sCreate\sa\sfile\ssymlink\s'bar.txt'\s->\s'res\\foo.txt'\s:\smklink\sbar.txt\sres\\foo.txt\r\n\s\s2.d.\sCreate\sa\sfolder\s'src'\s:\smkdir\ssrc\r\n\s\s2.e.\sCreate\sa\sdirectory\ssymlink\s'src/myres'\s->\s'res'\s:\smklink\s/D\ssrc\\myres\s..\\res\r\n\s\s2.f.\sYou\sshould\shave\sthe\slayout\sgiven\sby\sthe\s'dir\s/s'\scommand\sbelow\r\n3.\sRun\swish/tclsh\susing\s"Run\sAs\sAdministrator"\r\n\s\s3.a.\sexec\sfsutil\sdirty\squery\s->\sShould\sget\sa\s'Usage'\smessage\sif\syou\shave\selevated\spermissions\r\n\s\s3.b.\sfile\scopy\sbar.txt\sbaz.txt\s->\ssucceeds,\scopies\scontent\snot\slink\r\n\s\s3.c.\sfile\scopy\ssrc/myres\sdest\s->\sERROR:\serror\scopying\s"src/myres"\sto\s"dest":\sillegal\soperation\son\sa\sdirectory\s\r\n\s\s3.d.\sfile\scopy\ssrc\sdest\s->\sERROR:\serror\scopying\s"src"\sto\s"dest":\s"C:/Temp/tcllink/dest\\myres":\spermission\sdenied\r\n\s\s3.e.\sfile\scopy\ssrc/myres\sdest\s->\sERROR:\serror\scopying\s"src/myres"\sto\s"dest/myres":\sillegal\soperation\son\sa\sdirectory\r\n"C:/Temp/tcllink/dest\\myres":\spermission\sdenied\r\n4.\sRun\swish/tclsh\s*not\sas\sAdministrator*\s(so\snot\sfrom\syour\sopen\scommand\sprompt!)\r\n\s\s4.a.\sexec\sfsutil\sdirty\squery\s->\s"The\sFSUTIL\sutility\srequires\sthat\syou\shave\sadministrative\sprivileges"\r\n\s\s4.b.\sfile\scopy\sbar.txt\sbaz.txt\s->\ssucceeds,\scopies\scontent\snot\slink\r\n\s\s4.c.\sfile\scopy\ssrc/myres\sdest\s->\sERROR:\serror\scopying\s"src/myres"\sto\s"dest":\sillegal\soperation\son\sa\sdirectory\r\n\s\s4.d.\sfile\scopy\ssrc\sdest\s->\sERROR:\serror\scopying\s"src"\sto\s"dest/src":\s"C:/Temp/tcllink/dest/src\\myres":\spermission\sdenied\r\n\s\s4.e.\sfile\scopy\ssrc/myres\sdest\s->\sERROR:\serror\scopying\s"src/myres"\sto\s"dest/myres":\sillegal\soperation\son\sa\sdirectory\r\n\r\n\r\n-----\sdir\s/s\s--------------------------------------------------\r\n\sVolume\sin\sdrive\sC\shas\sno\slabel.\r\n\sVolume\sSerial\sNumber\sis\sEA57-23EF\r\n\r\n\sDirectory\sof\sC:\\Temp\\tcllink\r\n\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s.\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s..\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<SYMLINK>\s\s\s\s\s\sbar.txt\s[res\\foo.txt]\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\sres\r\n2015/11/23\s\s11:28\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\ssrc\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s1\sFile(s)\s\s\s\s\s\s\s\s\s\s\s\s\s\s0\sbytes\r\n\r\n\sDirectory\sof\sC:\\Temp\\tcllink\\res\r\n\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s.\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s..\r\n2015/11/23\s\s11:27\sAM\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s8\sfoo.txt\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s1\sFile(s)\s\s\s\s\s\s\s\s\s\s\s\s\s\s8\sbytes\r\n\r\n\sDirectory\sof\sC:\\Temp\\tcllink\\src\r\n\r\n2015/11/23\s\s11:28\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s.\r\n2015/11/23\s\s11:28\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s..\r\n2015/11/23\s\s11:28\sAM\s\s\s\s<SYMLINKD>\s\s\s\s\smyres\s[..\\res]\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s0\sFile(s)\s\s\s\s\s\s\s\s\s\s\s\s\s\s0\sbytes\r\n\r\n\sDirectory\sof\sC:\\Temp\\tcllink\\src\\myres\r\n\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s.\r\n2015/11/23\s\s11:27\sAM\s\s\s\s<DIR>\s\s\s\s\s\s\s\s\s\s..\r\n2015/11/23\s\s11:27\sAM\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s8\sfoo.txt\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s1\sFile(s)\s\s\s\s\s\s\s\s\s\s\s\s\s\s8\sbytes
J foundin 8.6.2
J is_private 0
J login twylite
J priority 5\sMedium
J private_contact 668a819fc68ae3df87285ba92d1fd8ef824e2d2b
J resolution None
J severity Important
J status Open
J submitter twylite
J subsystem 37.\sFile\sSystem
J title file\scopy\s"permission\sdenied"\sfor\sWindows\ssymlinks
J type Bug
K 972c35d41d10fa76718dfd67bf8db3ef10b85789
U twylite
Z 8c45421bd94f981d9c69b9ec201582cc