{"thread":{"id":"30681","subject":"Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config","startedAt":"2012-06-01T19:49:07Z","lastAt":"2012-06-04T17:27:47Z","messageCount":2,"participants":["nguyenhu@minatec.inpg.fr","Ramsay Jones"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192689","messageId":"20120601214907.Horde.e8FjWXwdC4BPyRyzuIrz5oA@webmail.minatec.grenoble-inp.fr","threadId":"30681","inReplyTo":null,"subject":"Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config","fromName":"","fromEmail":"nguyenhu@minatec.inpg.fr","sentAt":"2012-06-01T19:49:07Z","receivedAt":"2012-06-01T19:49:07Z","isPatch":false,"sender":{"key":"nguyenhu@minatec.inpg.fr","avatar":null},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> I have not tried this patch (or the v3 version, which I haven't read  \n> yet), but\n> is it likely that this has re-introduced the bug addressed by commit 05bab3ea\n> (\"config.c: Fix a static buffer overwrite bug by avoiding mkpath()\",  \n> >19-11-2011)?.\n>\n> I don't know the answer, but I suspect that it may have done just  \n> that. >(indeed, it\n> may well have made the bug more likely to appear).\n>\n>\n>> The original that read from $HOME/.gitconfig was simple enough so\n>> having three copies of getenv(\"HOME\") was perfectly fine, but as you\n>> are introduce this much complexity to to decide which two files to\n>> read from, the code added this patch needs to be refactored and\n>> three copies of the same logic need to be consolidated, I would have\n>> to say.\n>\n> I agree. Also, using mksnpath() in the refactored code (rather than\n> mkpath()) would be a good idea. :-P\n>\n> ATB,\n> Ramsay Jones\n\nIs not mkpath() the same function as mksnpath with char *buff =  \nbuf[PATH_MAX] and size_t n = sizeof(buf) ?\n"},{"id":"192830","messageId":"4FCCF013.1020000@ramsay1.demon.co.uk","threadId":"30681","inReplyTo":"20120601214907.Horde.e8FjWXwdC4BPyRyzuIrz5oA@webmail.minatec.grenoble-inp.fr","subject":"Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-06-04T17:27:47Z","receivedAt":"2012-06-04T17:27:47Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"nguyenhu@minatec.inpg.fr wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>> I have not tried this patch (or the v3 version, which I haven't read  \n>> yet), but\n>> is it likely that this has re-introduced the bug addressed by commit 05bab3ea\n>> (\"config.c: Fix a static buffer overwrite bug by avoiding mkpath()\",  \n>>> 19-11-2011)?.\n>> I don't know the answer, but I suspect that it may have done just  \n>> that. >(indeed, it\n>> may well have made the bug more likely to appear).\n>>\n>>\n>>> The original that read from $HOME/.gitconfig was simple enough so\n>>> having three copies of getenv(\"HOME\") was perfectly fine, but as you\n>>> are introduce this much complexity to to decide which two files to\n>>> read from, the code added this patch needs to be refactored and\n>>> three copies of the same logic need to be consolidated, I would have\n>>> to say.\n>> I agree. Also, using mksnpath() in the refactored code (rather than\n>> mkpath()) would be a good idea. :-P\n>>\n>> ATB,\n>> Ramsay Jones\n> \n> Is not mkpath() the same function as mksnpath with char *buff =  \n> buf[PATH_MAX] and size_t n = sizeof(buf) ?\n\nI'm sorry but I just can't understand your question. :(\n\nHave you looked at commit 05bab3ea? Is the commit message unclear?\n\nThe main difference between mkpath() and mksnpath(), as far as this bug\nis concerned, is that mkpath() returns a reference to *recycled* internal\nstatic buffers, whereas mksnpath() does not (you provide your own).\n\nThis evening I finally had a look at your patch, well v4 of the patch, and\nI can confirm that it does indeed re-introduce the bug. I will reply to the\nv4 patch email with more comments.\n\nHTH\n\nATB,\nRamsay Jones\n"}]}