{"id":812812,"url":"http://patchwork.ozlabs.org/api/patches/812812/?format=json","web_url":"http://patchwork.ozlabs.org/project/swupdate/patch/1505217419-28446-1-git-send-email-sbabic@denx.de/","project":{"id":58,"url":"http://patchwork.ozlabs.org/api/projects/58/?format=json","name":"swupdate development","link_name":"swupdate","list_id":"swupdate.googlegroups.com","list_email":"swupdate@googlegroups.com","web_url":"https://github.com/sbabic/swupdate","scm_url":"git://github.com/sbabic/swupdate","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505217419-28446-1-git-send-email-sbabic@denx.de>","list_archive_url":null,"date":"2017-09-12T11:56:59","name":"[V3] Fix usage of TMPDIR","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"fba85b6567fb8cf9da61efff702927416076486b","submitter":{"id":5771,"url":"http://patchwork.ozlabs.org/api/people/5771/?format=json","name":"Stefano Babic","email":"sbabic@denx.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/swupdate/patch/1505217419-28446-1-git-send-email-sbabic@denx.de/mbox/","series":[{"id":2682,"url":"http://patchwork.ozlabs.org/api/series/2682/?format=json","web_url":"http://patchwork.ozlabs.org/project/swupdate/list/?series=2682","date":"2017-09-12T11:56:59","name":"[V3] Fix usage of TMPDIR","version":3,"mbox":"http://patchwork.ozlabs.org/series/2682/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812812/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812812/checks/","tags":{},"related":[],"headers":{"Return-Path":"<swupdate+bncBAABBEUX37GQKGQEQIJV4YY@googlegroups.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=googlegroups.com\n\t(client-ip=2a00:1450:4010:c07::237;\n\thelo=mail-lf0-x237.google.com;\n\tenvelope-from=swupdate+bncbaabbeux37gqkgqeqijv4yy@googlegroups.com;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=googlegroups.com header.i=@googlegroups.com\n\theader.b=\"oiClnmzj\"; dkim-atps=neutral"],"Received":["from mail-lf0-x237.google.com (mail-lf0-x237.google.com\n\t[IPv6:2a00:1450:4010:c07::237])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs3F26SyKz9t2V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 21:57:09 +1000 (AEST)","by mail-lf0-x237.google.com with SMTP id 23sf333668lfs.12\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 04:57:09 -0700 (PDT)","by 10.46.25.83 with SMTP id p80ls89907lje.47.gmail;\n\tTue, 12 Sep 2017 04:57:05 -0700 (PDT)","from mail-out.m-online.net (mail-out.m-online.net.\n\t[2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id\n\tr3si698543wmg.6.2017.09.12.04.57.05 for <swupdate@googlegroups.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 12 Sep 2017 04:57:05 -0700 (PDT)","from frontend03.mail.m-online.net (unknown [192.168.6.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xs3Dx4DjPz1qvyk;\n\tTue, 12 Sep 2017 13:57:05 +0200 (CEST)","from localhost (dynscan3.mnet-online.de [192.168.6.84])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xs3Dx42mlz1qsQ3;\n\tTue, 12 Sep 2017 13:57:05 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id o-xIYenLqzrs; Tue, 12 Sep 2017 13:57:04 +0200 (CEST)","from babic.homelinux.org\n\t(host-88-217-136-221.customer.m-online.net [88.217.136.221])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tTue, 12 Sep 2017 13:57:04 +0200 (CEST)","from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id 69F5145405CE;\n\tTue, 12 Sep 2017 13:57:04 +0200 (CEST)","from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id of8CgLAvaPFC; Tue, 12 Sep 2017 13:57:02 +0200 (CEST)","from papero.fritz.box (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id 00CCC45405CD;\n\tTue, 12 Sep 2017 13:57:01 +0200 (CEST)"],"ARC-Seal":["i=2; a=rsa-sha256; t=1505217426; cv=pass;\n\td=google.com; s=arc-20160816;\n\tb=CWwWOZ57XR/z4uGkwytPjrx3CWpKAavB19FaGP/1XCy4E5D8MEiLt2eoB/TS0fKQO7\n\t05RSBmJvBFFXsGmwkwFtRQPkaIakMuGREuFc1B2xy5P7TbiiEolAsJm9jmTfQMWErQ2d\n\tjUZxHnWLcbefWDO/G4sdhJY5QmA3Edar37UgN3pS16O0gSRsP9P3u8p1xRS3+zOwNcF3\n\t/hH6+OxdoWNY+3gwucBCrY8DJKg/GYCjZk0NVhqy+IDtQcCkZoRy9JnEOJor/FsDcWcV\n\tsweXTl/Rh0NSaIpTflOeGdGovTmYs/It5fgAcXS2OblBA/lcNpCPIizv147eSfbHVWAR\n\tCx2A==","i=1; a=rsa-sha256; t=1505217425; cv=none;\n\td=google.com; s=arc-20160816;\n\tb=Lm0qrr1UBUWwpId5aCP6yOyUsRr9+G8FpGKRBMqhfO+IGVcK4UV5LmO81Bfn/vrCdC\n\tfOICisST3WgDGyEjWmD0SwWywNcfMvrSRvsei5vaV9CNIjrUCB6cRK7wADCpQc9hRPu8\n\t2f1bA23vbaC/1mqdDW0Ee0W/hY2LRAYO3TKwHDIPJ7Lkl+If841nl3WRGW2lb2GZSc7I\n\tM4ZTO6kOvMpRveSJgoRLbqpTeXRUfkaDgxRZNfytc1eL+YuOdoIxZCpsWT3YpwFbztle\n\tg7tzlzGpqa4ea6b3L0Fc4+QewE3GMDm/wVVw+Ajp3uSVKV/63t4g9zhCpE4BAZD++RpP\n\tZcng=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n\t:list-id:mailing-list:precedence:message-id:date:subject:cc:to:from\n\t:arc-authentication-results:arc-message-signature:mime-version\n\t:sender:dkim-signature:arc-authentication-results;\n\tbh=vGeWD25X9sJCUinZXszxgUSVqhlay0UzWKLmgFV/LXg=;\n\tb=1EihXkVnJrjcy8e1ZmZZ6hu8wkrIsmU0p7eZAI/g+QHIMobpNCkiMnfhku/Kj8P2yj\n\t86e73/wUBpNKxOhJyWvXVwk1ygqbuh24Rzc1nlII/W78ytbIAs7bnDk3kolUqfbKK5BR\n\t3S9GHKg/gZHXd2iKV/jgrO/47V/Kyw4qvSOcRou0Gcpvbr0vjt3y+v9hm7OLts5OIU33\n\tC2kBtw8Cy7TcaKZOi5Iq3Q7aWAJ3lvU8qLSALEJNkEb8VmYjveKPFnrIl3vAMQk6qSri\n\tYQhGsYzJNTga5pk2UZse7LmHY2pwxvwgyT7KWR7iB+AGg1U+GBfKTpZZIl9ZVD2j2O3Z\n\t+LuQ==","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=message-id:date:subject:cc:to:from:arc-authentication-results;\n\tbh=9fWr/EYlW+1+zmzEVr7lQrj4oJWAKJBDLeFYu7icmFA=;\n\tb=wzb4K+fuWSNUCZHj0WklKnySVPa3veVQ0qnuwyAuF3t7/YKibvjJ4fYVYudO9vBeii\n\t6mSA1EMC5sIzz8ti1II6I3zUzV89fv8EPwF6itqD/0pgyIX42b4baMRzko+ubWIXZgxJ\n\tzhBpzz7eDpbt2X8ZfwL1vWDD8yusvDsV4H3KBBxVyUZl9g/E0jTF7h+7qXOiIVoCcixY\n\tS1+UyIYGrELqAIM99ySpKmwTHFHwQYv4PuZVF2Ut5FhL54n+Slzi44XYkukMIrbE7m2Q\n\tBJcEMObsea5ovABHZfP3T1myZ6rORSEAfLAY9tFRhGy61JZJigvv8qvVGPrM3Wd2jTay\n\t6wHA=="],"ARC-Authentication-Results":["i=2; gmr-mx.google.com;\n\tspf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted\n\tnor denied by best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de","i=1; gmr-mx.google.com;\n\tspf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted\n\tnor denied by best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=googlegroups.com; s=20161025;\n\th=sender:mime-version:from:to:cc:subject:date:message-id\n\t:x-original-sender:x-original-authentication-results:precedence\n\t:mailing-list:list-id:list-post:list-help:list-archive\n\t:list-subscribe:list-unsubscribe;\n\tbh=vGeWD25X9sJCUinZXszxgUSVqhlay0UzWKLmgFV/LXg=;\n\tb=oiClnmzjbSvtcRrmAhy5q6DK/Sqw04yMKIaBthXhCIyTxE+l9Ju2dLRO4ogkALdOpF\n\t8q4GZl++jdBD/bEMWu5ljUYme3AMEomT0MsWiylmQVwPCnSDYxtddcyjOu21KMjCpD1+\n\tVwrsyRAOD5IowchZ7uT9BcQVdbu6ekOVicBU9dm8Kpi1ztQJOxD5HclwxBmBNECSDQRp\n\tnbUOcb7V4T7gxVFVJ+0kNAZQdDgH/Ay23oGFX/wlV+A4719WvmS5byP19cFmoGW4NkYD\n\tmRu3p579N3Uv+Z34UoWqJ1O65tlplSq4UxYqbIkFU1eM74V3mS9gWGu+/79cu+2yCZO9\n\tifoQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=sender:x-gm-message-state:mime-version:from:to:cc:subject:date\n\t:message-id:x-original-sender:x-original-authentication-results\n\t:precedence:mailing-list:list-id:x-spam-checked-in-group:list-post\n\t:list-help:list-archive:list-subscribe:list-unsubscribe;\n\tbh=vGeWD25X9sJCUinZXszxgUSVqhlay0UzWKLmgFV/LXg=;\n\tb=iYqIpUBz7rG0VJFfDTWvam0qXIO/XvBETHq9ulmnLt5QaY9dN1EZW1giJFjPF6CZ9f\n\tI/lXUc5oXA4VkOol8Q5DYt6lKbQ73I4MLDasPCyr+QlPBmU2ouGylhd0wS2fp8AeqPwJ\n\tvxpSuMa+XWl14H02fYDO06wsIeY3oeblevp1kCGvcNuq+UAGBAbO4HVCCbsRZPIMr+x/\n\tnLZFGUxaomEk1e7B+aGlhDmzBVwW8SXalWwaIl9TtfUzJt2eoPX42iUDwRlMF5TUF+6A\n\tQfftU8yVpSNacQum1Bi43fM8XUZAEGzmNs+XKB7N2UL5kJNaBge+gmDiRBykwFcVihLp\n\tD1+Q==","Sender":"swupdate@googlegroups.com","X-Gm-Message-State":"AHPjjUgHMy5AoF8QrEAO8SJF+hWs9R3OuA2pZwmrhcHSWIOgWTi1tUK8\n\t4YVtgswYr63e2A==","X-Google-Smtp-Source":"AOwi7QAta3p+1CuDH4CPaf/DU+KyQtYT8Cqpp60/9nFW5zgGgwqlF28Z6Mmn7iTPc8fsbENTzcFrcw==","X-Received":["by 10.46.2.85 with SMTP id 82mr2027ljc.16.1505217426065;\n\tTue, 12 Sep 2017 04:57:06 -0700 (PDT)","by 10.46.92.193 with SMTP id q184mr1168354ljb.34.1505217425946; \n\tTue, 12 Sep 2017 04:57:05 -0700 (PDT)"],"MIME-Version":"1.0","X-BeenThere":"swupdate@googlegroups.com","Received-SPF":"neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither\n\tpermitted nor denied by best guess record for domain of\n\tsbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; ","X-Virus-Scanned":["amavisd-new at mnet-online.de","Debian amavisd-new at babic.homelinux.org"],"From":"Stefano Babic <sbabic@denx.de>","To":"swupdate@googlegroups.com","Cc":"Stefano Babic <sbabic@denx.de>","Subject":"[swupdate] [PATCH V3] Fix usage of TMPDIR","Date":"Tue, 12 Sep 2017 13:56:59 +0200","Message-Id":"<1505217419-28446-1-git-send-email-sbabic@denx.de>","X-Mailer":"git-send-email 2.7.4","X-Original-Sender":"sbabic@denx.de","X-Original-Authentication-Results":"gmr-mx.google.com;       spf=neutral\n\t(google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied\n\tby best\n\tguess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","Precedence":"list","Mailing-list":"list swupdate@googlegroups.com;\n\tcontact swupdate+owners@googlegroups.com","List-ID":"<swupdate.googlegroups.com>","X-Spam-Checked-In-Group":"swupdate@googlegroups.com","X-Google-Group-Id":"605343134186","List-Post":"<https://groups.google.com/group/swupdate/post>,\n\t<mailto:swupdate@googlegroups.com>","List-Help":"<https://groups.google.com/support/>,\n\t<mailto:swupdate+help@googlegroups.com>","List-Archive":"<https://groups.google.com/group/swupdate","List-Subscribe":"<https://groups.google.com/group/swupdate/subscribe>,\n\t<mailto:swupdate+subscribe@googlegroups.com>","List-Unsubscribe":"<mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,\n\t<https://groups.google.com/group/swupdate/subscribe>"},"content":"Commit 7ce284c5401c64bcd54e469ce8a3f7639e28ed3a makes TMPDIR\nconfigurable. Fix the remaining sources that use the TMPDIR variable.\n\nSigned-off-by: Stefano Babic <sbabic@denx.de>\nAcked-by: Christian Storm <christian.storm@siemens.com>\n---\n corelib/lua_interface.c           | 1 +\n handlers/flash_hamming1_handler.c | 1 +\n handlers/flash_handler.c          | 1 +\n handlers/lua_scripthandler.c      | 7 +++++--\n 4 files changed, 8 insertions(+), 2 deletions(-)","diff":"diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c\nindex 90c2230..5717807 100644\n--- a/corelib/lua_interface.c\n+++ b/corelib/lua_interface.c\n@@ -401,6 +401,7 @@ static int l_handler_wrapper(struct img_type *img, void *data) {\n \tlua_Number result;\n \tint l_func_ref;\n \tint fdout;\n+\tconst char* TMPDIR = get_tmpdir();\n \n \tif (!gL || !img || !data) {\n \t\treturn -1;\ndiff --git a/handlers/flash_hamming1_handler.c b/handlers/flash_hamming1_handler.c\nindex 44141fd..8b54d3a 100644\n--- a/handlers/flash_hamming1_handler.c\n+++ b/handlers/flash_hamming1_handler.c\n@@ -294,6 +294,7 @@ static int install_flash_hamming_image(struct img_type *img,\n \tchar filename[64];\n \tint mtdnum;\n \tint n;\n+\tconst char* TMPDIR = get_tmpdir();\n \n \tn = snprintf(filename, sizeof(filename), \"%s%s\", TMPDIR, img->fname);\n \tif (n < 0 || n >= sizeof(filename)) {\ndiff --git a/handlers/flash_handler.c b/handlers/flash_handler.c\nindex 081c2a4..ff27aa7 100644\n--- a/handlers/flash_handler.c\n+++ b/handlers/flash_handler.c\n@@ -312,6 +312,7 @@ static int install_flash_image(struct img_type *img,\n \tchar filename[64];\n \tint mtdnum;\n \tint n;\n+\tconst char* TMPDIR = get_tmpdir();\n \n \tn = snprintf(filename, sizeof(filename), \"%s%s\", TMPDIR, img->fname);\n \tif (n < 0 || n >= sizeof(filename)) {\ndiff --git a/handlers/lua_scripthandler.c b/handlers/lua_scripthandler.c\nindex a3df317..1793878 100644\n--- a/handlers/lua_scripthandler.c\n+++ b/handlers/lua_scripthandler.c\n@@ -44,9 +44,11 @@ static int start_lua_script(struct img_type *img, void *data)\n \tint ret;\n \tconst char *fnname;\n \tconst char *output;\n-\tchar filename[64];\n \tscript_fn scriptfn;\n \tlua_State *L = luaL_newstate(); /* opens Lua */\n+\tconst char* TMPDIR = get_tmpdir();\n+\tchar filename[MAX_IMAGE_FNAME + strlen(TMPDIR) +\n+\t\tstrlen(SCRIPTS_DIR_SUFFIX) + 2];\n \n \tif (!data)\n \t\treturn -1;\n@@ -65,7 +67,8 @@ static int start_lua_script(struct img_type *img, void *data)\n \t\treturn 0;\n \t}\n \n-\tsnprintf(filename, sizeof(filename), \"%s%s\", TMPDIR, img->fname);\n+\tsnprintf(filename, sizeof(filename),\n+\t\t\"%s%s%s\", TMPDIR, SCRIPTS_DIR_SUFFIX, img->fname);\n \tTRACE(\"Calling Lua %s\", filename);\n \n \tluaL_openlibs(L); /* opens the standard libraries */\n","prefixes":["V3"]}