)]}'
{"oslo_utils/fileutils.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d29986bbd9f3061b02dae7f44c0a3e7d04b3fe6d","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":"    if path:"},{"line_number":92,"context_line":"        ensure_tree(path)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    (fd, path) \u003d tempfile.mkstemp(suffix\u003dsuffix, dir\u003dpath, prefix\u003dprefix)"},{"line_number":95,"context_line":"    try:"},{"line_number":96,"context_line":"        os.write(fd, content)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_f856e35c","line":93,"updated":"2015-07-08 21:20:11.000000000","message":"Why even use mkstemp?\n\nThis just seems equivalent to using https://docs.python.org/3/library/tempfile.html#tempfile.mktemp which its not recommended to use, so I don\u0027t quite understand why we would want to provide a function that may introduce a security hole in the using program.","commit_id":"36d599f477b38be2899604304523e07d998bd0d6"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"4b68022b132bd78c945d15d8ed4504dc402b9267","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":"    if path:"},{"line_number":92,"context_line":"        ensure_tree(path)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    (fd, path) \u003d tempfile.mkstemp(suffix\u003dsuffix, dir\u003dpath, prefix\u003dprefix)"},{"line_number":95,"context_line":"    try:"},{"line_number":96,"context_line":"        os.write(fd, content)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_c7ad1432","line":93,"in_reply_to":"ba3cc151_0829e49a","updated":"2015-07-09 13:32:39.000000000","message":"you\u0027ve lost me on how it\u0027s not secure?\n\n  tempfile.mkstemp(suffix\u003d\u0027\u0027, prefix\u003d\u0027tmp\u0027, dir\u003dNone, text\u003dFalse)\n    Creates a temporary file in the most secure manner possible.\n\nhttps://docs.python.org/3/library/tempfile.html#tempfile.mkstemp","commit_id":"36d599f477b38be2899604304523e07d998bd0d6"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"be2bab53c84f646e3c3c8723f2e68e4d3ff253ab","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":"    if path:"},{"line_number":92,"context_line":"        ensure_tree(path)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    (fd, path) \u003d tempfile.mkstemp(suffix\u003dsuffix, dir\u003dpath, prefix\u003dprefix)"},{"line_number":95,"context_line":"    try:"},{"line_number":96,"context_line":"        os.write(fd, content)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_5a1b0e73","line":93,"in_reply_to":"ba3cc151_c7ad1432","updated":"2015-07-09 16:20:49.000000000","message":"Yes, but what this function does is make a tempfile, then write some content, then return the path for further usage, someone can then get the same path name (or even overwrite the file or other things??) since the file descriptor is closed before return.\n\nWhich seems pretty much like mktemp (or a variation of it):\n\n   \"\"Return an absolute pathname of a file that did not exist at the time the call is made.  By the time you get around to doing anything with the file name it returns, someone else may have beaten you to the punch.\"\"\n\nSo just stating that it feels sorta odd that this closes the file descriptor and then returns the path (which seems sorta like its making the whole thing less secure, idk).","commit_id":"36d599f477b38be2899604304523e07d998bd0d6"},{"author":{"_account_id":8911,"name":"Sergey Vilgelm","email":"sergey@vilgelm.info","username":"sergey.vilgelm"},"change_message_id":"39faece0b8e87b67dfd4c97e4881ae236f702263","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":"    if path:"},{"line_number":92,"context_line":"        ensure_tree(path)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    (fd, path) \u003d tempfile.mkstemp(suffix\u003dsuffix, dir\u003dpath, prefix\u003dprefix)"},{"line_number":95,"context_line":"    try:"},{"line_number":96,"context_line":"        os.write(fd, content)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba3cc151_0829e49a","line":93,"in_reply_to":"ba3cc151_f856e35c","updated":"2015-07-09 06:47:07.000000000","message":"mkstemp is more secure than mktemp: https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp\nand i don\u0027t see the reasons for using anything other.","commit_id":"36d599f477b38be2899604304523e07d998bd0d6"}]}
