{"thread":{"id":"38304","subject":"Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","startedAt":"2015-01-07T23:26:50Z","lastAt":"2015-01-08T19:42:52Z","messageCount":11,"participants":["Dmitry Bykov","Stefan Beller","Junio C Hamano","Johannes Schindelin","Jeff King","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"254434","messageId":"CADb7K9rELHWgy_NYJWrSr9gZn7pcMvETv93d0j+u2fXinj5iTg@mail.gmail.com","threadId":"38304","inReplyTo":null,"subject":"Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Dmitry Bykov","fromEmail":"pvrt74@gmail.com","sentAt":"2015-01-07T23:26:50Z","receivedAt":"2015-01-07T23:26:50Z","isPatch":false,"sender":{"key":"pvrt74@gmail.com","avatar":null},"body":"Hello,\n\nRecently I installed 1.9.5 git version and faced the problem that one\nof the files in my cloned repository with a name ICON~714.PNG is\nmarked as deleted even repository was freshly cloned. Trying to do\nanything with that file resulted in constant \"Invalid Path\" errors.\nReverting back to 1.9.4. fixed that problem.\n\nThanks,\nDmitry\n"},{"id":"254435","messageId":"CAGZ79kbZr+2U-NpAHKvSLkj0D6ZXwoOcjghcdmdtfOkdkVBr9A@mail.gmail.com","threadId":"38304","inReplyTo":"CADb7K9rELHWgy_NYJWrSr9gZn7pcMvETv93d0j+u2fXinj5iTg@mail.gmail.com","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-01-07T23:35:14Z","receivedAt":"2015-01-07T23:35:14Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Jan 7, 2015 at 3:26 PM, Dmitry Bykov <pvrt74@gmail.com> wrote:\n> Hello,\n>\n> Recently I installed 1.9.5 git version and faced the problem that one\n> of the files in my cloned repository with a name ICON~714.PNG is\n> marked as deleted even repository was freshly cloned. Trying to do\n> anything with that file resulted in constant \"Invalid Path\" errors.\n> Reverting back to 1.9.4. fixed that problem.\n>\n> Thanks,\n> Dmitry\n\nGit had a security issue with filenames which look similar to the .git\nrepository.\nPlease see the announcement at\nhttp://article.gmane.org/gmane.linux.kernel/1853266\n(That also updated 1.9.4 -> 1.9.5)\n\nI'm not sure if I can advice though.\n"},{"id":"254436","messageId":"CAPc5daVddkaMkx=43nCeQKbbkrV6nExOqvEBJNyugzDQB2n6kQ@mail.gmail.com","threadId":"38304","inReplyTo":"CADb7K9rELHWgy_NYJWrSr9gZn7pcMvETv93d0j+u2fXinj5iTg@mail.gmail.com","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-07T23:35:30Z","receivedAt":"2015-01-07T23:35:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dscho, this sounds to me like the additional \"8.3 ambiguity\nprotection\" (which is only in Git for Windows) in action. Any\nthoughts?\n\nOn Wed, Jan 7, 2015 at 3:26 PM, Dmitry Bykov <pvrt74@gmail.com> wrote:\n> Hello,\n>\n> Recently I installed 1.9.5 git version and faced the problem that one\n> of the files in my cloned repository with a name ICON~714.PNG is\n> marked as deleted even repository was freshly cloned. Trying to do\n> anything with that file resulted in constant \"Invalid Path\" errors.\n> Reverting back to 1.9.4. fixed that problem.\n>\n> Thanks,\n> Dmitry\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"254456","messageId":"alpine.DEB.1.00.1501081100570.21312@s15462909.onlinehome-server.info","threadId":"38304","inReplyTo":"CAPc5daVddkaMkx=43nCeQKbbkrV6nExOqvEBJNyugzDQB2n6kQ@mail.gmail.com","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-01-08T10:06:18Z","receivedAt":"2015-01-08T10:06:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 7 Jan 2015, Junio C Hamano wrote:\n\n> Dscho, this sounds to me like the additional \"8.3 ambiguity\n> protection\" (which is only in Git for Windows) in action. Any\n> thoughts?\n\nFirst thought: the Git for Windows mailing list should be Cc:ed (I was\ntraveling yesterday and somebody else might have been able to address\nDmitry's problem).\n\nSecond thought below:\n\n> On Wed, Jan 7, 2015 at 3:26 PM, Dmitry Bykov <pvrt74@gmail.com> wrote:\n> >\n> > Recently I installed 1.9.5 git version and faced the problem that one\n> > of the files in my cloned repository with a name ICON~714.PNG is\n> > marked as deleted even repository was freshly cloned. Trying to do\n> > anything with that file resulted in constant \"Invalid Path\" errors.\n> > Reverting back to 1.9.4. fixed that problem.\n\nICON~714.PNG is a valid short name for a long name (such as\n'icon.background.png') because it fits the shortening scheme (8.3 format,\nthe base name ends in ~<n>). As this can clash with a validly shortened\nlong name, Git for Windows refuses to check out such paths by default.\n\nIf you want the old -- unsafe -- behavior back, just set your\ncore.protectNTFS to false (this means that you agree that the incurred\nproblems are your own responsibility and cannot be blamed on anybody else\n;-))\n\nCiao,\nJohannes\n"},{"id":"254457","messageId":"20150108102815.GA4806@peff.net","threadId":"38304","inReplyTo":"alpine.DEB.1.00.1501081100570.21312@s15462909.onlinehome-server.info","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-01-08T10:28:16Z","receivedAt":"2015-01-08T10:28:16Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jan 08, 2015 at 11:06:18AM +0100, Johannes Schindelin wrote:\n\n> ICON~714.PNG is a valid short name for a long name (such as\n> 'icon.background.png') because it fits the shortening scheme (8.3 format,\n> the base name ends in ~<n>). As this can clash with a validly shortened\n> long name, Git for Windows refuses to check out such paths by default.\n> \n> If you want the old -- unsafe -- behavior back, just set your\n> core.protectNTFS to false (this means that you agree that the incurred\n> problems are your own responsibility and cannot be blamed on anybody else\n> ;-))\n\nI wonder if it is worth having a \"git-only\" mode for core.protectNTFS.\nTurning it off entirely would make him susceptible to GIT~1 attacks.\n\n-Peff\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"254459","messageId":"alpine.DEB.1.00.1501081140070.21312@s15462909.onlinehome-server.info","threadId":"38304","inReplyTo":"20150108102815.GA4806@peff.net","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-01-08T10:40:27Z","receivedAt":"2015-01-08T10:40:27Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn Thu, 8 Jan 2015, Jeff King wrote:\n\n> On Thu, Jan 08, 2015 at 11:06:18AM +0100, Johannes Schindelin wrote:\n> \n> > ICON~714.PNG is a valid short name for a long name (such as\n> > 'icon.background.png') because it fits the shortening scheme (8.3 format,\n> > the base name ends in ~<n>). As this can clash with a validly shortened\n> > long name, Git for Windows refuses to check out such paths by default.\n> > \n> > If you want the old -- unsafe -- behavior back, just set your\n> > core.protectNTFS to false (this means that you agree that the incurred\n> > problems are your own responsibility and cannot be blamed on anybody else\n> > ;-))\n> \n> I wonder if it is worth having a \"git-only\" mode for core.protectNTFS.\n> Turning it off entirely would make him susceptible to GIT~1 attacks.\n\nThat is a good idea!\n\nCiao,\nDscho\n"},{"id":"254463","messageId":"54AE7F46.9060103@web.de","threadId":"38304","inReplyTo":"20150108102815.GA4806@peff.net","subject":"Re: Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-01-08T12:59:50Z","receivedAt":"2015-01-08T12:59:50Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 01/08/2015 11:28 AM, Jeff King wrote:\n> On Thu, Jan 08, 2015 at 11:06:18AM +0100, Johannes Schindelin wrote:\n>\n>> ICON~714.PNG is a valid short name for a long name (such as\n>> 'icon.background.png') because it fits the shortening scheme (8.3 format,\n>> the base name ends in ~<n>). As this can clash with a validly shortened\n>> long name, Git for Windows refuses to check out such paths by default.\n>>\n>> If you want the old -- unsafe -- behavior back, just set your\n>> core.protectNTFS to false (this means that you agree that the incurred\n>> problems are your own responsibility and cannot be blamed on anybody else\n>> ;-))\n> I wonder if it is worth having a \"git-only\" mode for core.protectNTFS.\n> Turning it off entirely would make him susceptible to GIT~1 attacks.\n>\n> -Peff\n>\nThere is something more then just the \"tilde\" protection going on, it seems:\n\n\ntorstenbogershausen@TORBOGWM ~/projects/test_tilde (master)\n$  ~/projects/git/msysgit/git ls-files\nICON~714.PNG\n\ntorstenbogershausen@TORBOGWM ~/projects/test_tilde (master)\n$  ~/projects/git/msysgit/git status\nOn branch master\nnothing to commit, working directory clean\n\ntorstenbogershausen@TORBOGWM ~/projects/test_tilde (master)\n$  ~/projects/git/tb/git status\nOn branch master\nnothing to commit, working directory clean\n\ntorstenbogershausen@TORBOGWM ~/projects/test_tilde (master)\n$  ~/projects/git/msysgit/git --version\ngit version 1.9.2.msysgit.0.2273.gc47d6ec\n\ntorstenbogershausen@TORBOGWM ~/projects/test_tilde (master)\n$  ~/projects/git/tb/git --version\ngit version 2.2.1.268.g1e6f5b2\n\nNeither latest msygit nor latest git.git reports a problem with a single \nfile\nwithin a short path.\nIt may be, that the '~' is not accepted in a long path or there are \n\"problems\"\nwhen a directory is filled with many files, but that is speculation.\n\nDimitry,\nis there a way to make the problem reproducible for other people ?\nEither a public demo-repo, or a step-by-step receipe  ?\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"254465","messageId":"alpine.DEB.1.00.1501081652230.21312@s15462909.onlinehome-server.info","threadId":"38304","inReplyTo":"54AE7F46.9060103@web.de","subject":"Re: [msysGit] Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-01-08T15:58:24Z","receivedAt":"2015-01-08T15:58:24Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Torsten,\n\nOn Thu, 8 Jan 2015, Torsten Bögershausen wrote:\n\n> There is something more then just the \"tilde\" protection going on, [...]\n\nIndeed. What is going on is that you build Git yourself, from git.git,\nwhile Dmitry obviously used Git for Windows -- which carries a couple of\npatches on top of upstream git.git.\n\nIn this particular case, the tilde protection was introduced in\nhttps://github.com/msysgit/git/commit/2e2a2d12.\n\nCiao,\nJohannes"},{"id":"254467","messageId":"54AEB246.4010109@web.de","threadId":"38304","inReplyTo":"alpine.DEB.1.00.1501081652230.21312@s15462909.onlinehome-server.info","subject":"Re: Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-01-08T16:37:26Z","receivedAt":"2015-01-08T16:37:26Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 01/08/2015 04:58 PM, Johannes Schindelin wrote:\n> Hi Torsten,\n> \n> On Thu, 8 Jan 2015, Torsten Bögershausen wrote:\n> \n>> There is something more then just the \"tilde\" protection going on, [...]\n> \n> Indeed. What is going on is that you build Git yourself, from git.git,\n> while Dmitry obviously used Git for Windows -- which carries a couple of\n> patches on top of upstream git.git.\n> \n> In this particular case, the tilde protection was introduced in\n> https://github.com/msysgit/git/commit/2e2a2d12.\n> \n> Ciao,\n> Johannes\n> \nMy bad, I was building the msysgit master branch, which didn't have the 2e2a2d12.\n\nHowever, I am wondering if 2e2a2d12 is really needed that much ?\nIn the same spirit that we do not prevent the checkout of \"FILE\" when \"file\" is present,\nwhy do we prevent people from using \"~\" in file names ?\nWhen a file is visible under different file names, I assume that the user chooses only\none representation to run \"git add\" on.\nBut that is another discussion.\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"254475","messageId":"xmqqegr5f5ts.fsf@gitster.dls.corp.google.com","threadId":"38304","inReplyTo":"20150108102815.GA4806@peff.net","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-08T19:08:47Z","receivedAt":"2015-01-08T19:08:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Jan 08, 2015 at 11:06:18AM +0100, Johannes Schindelin wrote:\n>\n>> ICON~714.PNG is a valid short name for a long name (such as\n>> 'icon.background.png') because it fits the shortening scheme (8.3 format,\n>> the base name ends in ~<n>). As this can clash with a validly shortened\n>> long name, Git for Windows refuses to check out such paths by default.\n>> \n>> If you want the old -- unsafe -- behavior back, just set your\n>> core.protectNTFS to false (this means that you agree that the incurred\n>> problems are your own responsibility and cannot be blamed on anybody else\n>> ;-))\n>\n> I wonder if it is worth having a \"git-only\" mode for core.protectNTFS.\n> Turning it off entirely would make him susceptible to GIT~1 attacks.\n\nYes, I think having distinctions would make sense, but I am not sure\nif \"git-only\" vs \"every questionable included\" should be the\nclassification.\n\nTo classify various funniness of paths by the extent of damage they\nmay cause for Windows:\n\n - \".Git\" and \"GIT~1\" would be the worst level; \n\n - \"CON.c\" and the like would be the next bad level; and\n\n - \"ICON~714.PNG\" would be in \"to be avoided in an ideal world but\n   as long as the project is comfortable with having it in, Git is\n   in no position to complain\" level.\n\nthat is just my knee-jerk reaction.\n\nAnd if we were to go with just two level, I'd throw \"CON.c\" into the\nsame level as \".Git\"; they both are to break the host that checks\nout such paths.  The former may break Git on the host, and the\nlatter may break something that is not Git on the host, but they are\nnot that different in that the end user on that host is harmed.\n\n\"8.3 ambiguity\" does not directly harm individual hosts, but the\nreason to flag is primarily because such a path may make the\nproject's contents unreliable (e.g. \"icon1234234.png\" may alias\n\"ICON~714.PNG\" on somebody's machine, causing confusion).  The same\nreason should make us flag a tree object as suspect if it contains\ntwo paths that are the same case-insensitively (e.g. a tree that\nrepresents the \"net/netfilter\" part of the Linux kernel source would\nbe flagged because it contains both \"xt_tcpmss.c\" and \"xt_TCPMSS.c\").\n\nLet's call the former Harmful and the latter Questionable.  \"CON.c\"\nis Harmful on Windows, while \"net/netfilter\" is Questionable on\nWindows.  Orthogonal to this, we earlier discussed what to do in\nfsck and receive.fsckObjects.  I think we want to be express\ndifferent shades of grays between the two extremes:\n\n - A repository of a mono-culture project would want to flag\n   Harmfuls and Questionables that apply to the project's intended\n   platform as errors.  By definition, a mono-culture project would\n   not care about paths that may only be Harmful on others'\n   platforms.\n\n - A repository for a cross-platform project would want to flag\n   paths that may be Harmful or Questionable on some platform, and\n   does not care if these paths are Harmful or Questionable on the\n   platform that happens to host the repository.  By definition, a\n   cross-platform project wants to make sure everybody involved will\n   not get hurt.\n"},{"id":"254480","messageId":"20150108194252.GA19867@peff.net","threadId":"38304","inReplyTo":"xmqqegr5f5ts.fsf@gitster.dls.corp.google.com","subject":"Re: Probably a bug with \"~\" symbol in filenames on Windows 7 x64 in git 1.9.5","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-01-08T19:42:52Z","receivedAt":"2015-01-08T19:42:52Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jan 08, 2015 at 11:08:47AM -0800, Junio C Hamano wrote:\n\n> > I wonder if it is worth having a \"git-only\" mode for core.protectNTFS.\n> > Turning it off entirely would make him susceptible to GIT~1 attacks.\n> \n> Yes, I think having distinctions would make sense, but I am not sure\n> if \"git-only\" vs \"every questionable included\" should be the\n> classification.\n\nYeah, I agree with everything you said below (I should have said\n\"security-relevant\" instead of \"git-only\" originally). I also agree that\nthere may be more than two classifications, but I do not know enough\nabout the severity of the bad effects of each type to judge. I'd leave\nthat to the folks on each platform.\n\n-Peff\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"}]}