[{"id":1495,"web_url":"https://patchwork.libcamera.org/comment/1495/","msgid":"<560b09ef-7aaa-3114-9ec8-82fff8676a04@ideasonboard.com>","date":"2019-04-23T16:08:21","subject":"Re: [libcamera-devel] [PATCH] meson: fix build when sys/auxv.h and\n\tgetauxval() are not present","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Giulio,\n\nThank you for looking at this issue.\n\nFollowing the discussion at [0], I intend to try and implement a\nsecure_getenv() which does not use getauxval() instead.\n\nThe use of getauxval() is already a workaround for not having\nsecure_getenv() available, so we should instead determine if\nsecure_getenv() is provided, and if not use a fallback which is\nimplemented with issetugid().\n\n[0] https://marc.info/?l=buildroot&m=155510281716087&w=2\n\n\nOn 23/04/2019 12:09, Giulio Benetti wrote:\n> On some libc sys/auxv.h could not be present and getauxval() too.\n> This way build will fail.\n> \n> Check in meson if they are present and add HAVE_SYS_AUXV_H and\n> HAVE_GETAUXVAL defines to cxx arguments.\n> Add #ifdef HAVE_ statements around #include <sys/auxv.h> and getauxval()\n> in utils.cpp.\n> \n> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>\n> ---\n>  meson.build             | 12 ++++++++++++\n>  src/libcamera/utils.cpp |  4 ++++\n>  2 files changed, 16 insertions(+)\n> \n> diff --git a/meson.build b/meson.build\n> index 6e68c3e..72a3652 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -20,6 +20,18 @@ common_arguments = [\n>  c_arguments = common_arguments\n>  cpp_arguments = common_arguments\n>  \n> +cxx = meson.get_compiler('cpp')\n> +\n> +# check for header sys/auxv.h\n> +if cxx.has_header('sys/auxv.h')\n> +  cpp_arguments += ['-DHAVE_SYS_AUXV_H']\n> +endif\n> +\n> +# check for function getauxval()\n> +if cxx.has_function('getauxval')\n> +  cpp_arguments += ['-DHAVE_GETAUXVAL']\n\nbased on [1] I believe Meson discourages adding defines to the\ncpp_arguments where possible, and instead recommends generating a\nconfiguration header ... something like my old work-in-progress patch\nfor this topic:\n\n+cc = meson.get_compiler('c')\n+config_h = configuration_data()\n+\n+if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix: '#define\n_GNU_SOURCE')\n+    config_h.set('HAVE_SECURE_GETENV', 1)\n+else\n+    message('C library does not support secure_getenv, using getenv\ninstead')\n+endif\n+configure_file(output: 'config.h', configuration: config_h)\n+add_project_arguments('-include', 'config.h', language: 'c')\n\n\n[1] https://github.com/mesonbuild/meson/issues/2247\n\n> +endif\n> +\n>  add_project_arguments(c_arguments, language: 'c')\n>  add_project_arguments(cpp_arguments, language: 'cpp')\n>  \n> diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\n> index 66123b1..ae574ab 100644\n> --- a/src/libcamera/utils.cpp\n> +++ b/src/libcamera/utils.cpp\n> @@ -8,7 +8,9 @@\n>  #include \"utils.h\"\n>  \n>  #include <string.h>\n> +#ifdef HAVE_SYS_AUXV_H\n>  #include <sys/auxv.h>\n> +#endif\n>  \n>  /**\n>   * \\file utils.h\n> @@ -57,8 +59,10 @@ const char *basename(const char *path)\n>   */\n>  char *secure_getenv(const char *name)\n>  {\n> +#ifdef HAVE_GETAUXVAL\n>  \tif (getauxval(AT_SECURE))\n>  \t\treturn NULL;\n> +#endif\n>  \n\nThis fall through leaves systems without getauxval() vulnerable to\nattacks through set-uid programs...\n\nWould you like to create a new patch based on the above? If not I'll\nkeep this on my todo list for the coming week.\n\n\n>  \treturn getenv(name);\n>  }\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B59860004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2019 18:08:25 +0200 (CEST)","from [IPv6:2a02:c7f:1887:5d00:b0c2:4b68:bc6a:f6e] (unknown\n\t[IPv6:2a02:c7f:1887:5d00:b0c2:4b68:bc6a:f6e])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0F3B15F;\n\tTue, 23 Apr 2019 18:08:25 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1556035705;\n\tbh=LrUbatOuBBTDN4ZpmvQak9DXGjKe2w1mtgIjFYKRRqI=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=aCnen8NHL1YVOo9rMQFbJuVPmVbsSx46WSF4adZ35Twy0HQDBWFaKSroaI5L/miGs\n\tMPiqjEt17gqZ6jl6Ev3xYyke9PR5ksycGFA7qykTysCQU/z6os/JcVk/ikXMxL0CH3\n\tIfDv910F12HFqjgxXrBsSklWCGlw+WkggDFou3es=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Giulio Benetti <giulio.benetti@micronovasrl.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190423110939.113773-1-giulio.benetti@micronovasrl.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/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C29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<560b09ef-7aaa-3114-9ec8-82fff8676a04@ideasonboard.com>","Date":"Tue, 23 Apr 2019 17:08:21 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.6.1","MIME-Version":"1.0","In-Reply-To":"<20190423110939.113773-1-giulio.benetti@micronovasrl.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] meson: fix build when sys/auxv.h and\n\tgetauxval() are not present","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 23 Apr 2019 16:08:25 -0000"}},{"id":1496,"web_url":"https://patchwork.libcamera.org/comment/1496/","msgid":"<364aa322-85ca-2c17-984e-1e807bd832ca@micronovasrl.com>","date":"2019-04-23T16:19:09","subject":"Re: [libcamera-devel] [PATCH] meson: fix build when sys/auxv.h and\n\tgetauxval() are not present","submitter":{"id":16,"url":"https://patchwork.libcamera.org/api/people/16/","name":"Giulio Benetti","email":"giulio.benetti@micronovasrl.com"},"content":"Hi Kieran,\n\nIl 23/04/2019 18:08, Kieran Bingham ha scritto:\n> Hi Giulio,\n> \n> Thank you for looking at this issue.\n> \n> Following the discussion at [0], I intend to try and implement a\n> secure_getenv() which does not use getauxval() instead.\n> \n> The use of getauxval() is already a workaround for not having\n> secure_getenv() available, so we should instead determine if\n> secure_getenv() is provided, and if not use a fallback which is\n> implemented with issetugid().\n> \n> [0] https://marc.info/?l=buildroot&m=155510281716087&w=2\n\nI've missed that at all on Buildroot ML but it's good explained.\nThanks for pointing me.\n\n> \n> On 23/04/2019 12:09, Giulio Benetti wrote:\n>> On some libc sys/auxv.h could not be present and getauxval() too.\n>> This way build will fail.\n>>\n>> Check in meson if they are present and add HAVE_SYS_AUXV_H and\n>> HAVE_GETAUXVAL defines to cxx arguments.\n>> Add #ifdef HAVE_ statements around #include <sys/auxv.h> and getauxval()\n>> in utils.cpp.\n>>\n>> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>\n>> ---\n>>   meson.build             | 12 ++++++++++++\n>>   src/libcamera/utils.cpp |  4 ++++\n>>   2 files changed, 16 insertions(+)\n>>\n>> diff --git a/meson.build b/meson.build\n>> index 6e68c3e..72a3652 100644\n>> --- a/meson.build\n>> +++ b/meson.build\n>> @@ -20,6 +20,18 @@ common_arguments = [\n>>   c_arguments = common_arguments\n>>   cpp_arguments = common_arguments\n>>   \n>> +cxx = meson.get_compiler('cpp')\n>> +\n>> +# check for header sys/auxv.h\n>> +if cxx.has_header('sys/auxv.h')\n>> +  cpp_arguments += ['-DHAVE_SYS_AUXV_H']\n>> +endif\n>> +\n>> +# check for function getauxval()\n>> +if cxx.has_function('getauxval')\n>> +  cpp_arguments += ['-DHAVE_GETAUXVAL']\n> \n> based on [1] I believe Meson discourages adding defines to the\n> cpp_arguments where possible, and instead recommends generating a\n> configuration header ... something like my old work-in-progress patch\n> for this topic:\n> \n> +cc = meson.get_compiler('c')\n> +config_h = configuration_data()\n> +\n> +if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix: '#define\n> _GNU_SOURCE')\n> +    config_h.set('HAVE_SECURE_GETENV', 1)\n> +else\n> +    message('C library does not support secure_getenv, using getenv\n> instead')\n> +endif\n> +configure_file(output: 'config.h', configuration: config_h)\n> +add_project_arguments('-include', 'config.h', language: 'c')\n\nI didn't know about it, indeed this ^^^^^^^^^^^^^^ was my first choice, \nbut I thought it was too much for only 2 HAVE_* but [1] clarifies it \nvery well.\n\n> \n> [1] https://github.com/mesonbuild/meson/issues/2247\n> \n>> +endif\n>> +\n>>   add_project_arguments(c_arguments, language: 'c')\n>>   add_project_arguments(cpp_arguments, language: 'cpp')\n>>   \n>> diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\n>> index 66123b1..ae574ab 100644\n>> --- a/src/libcamera/utils.cpp\n>> +++ b/src/libcamera/utils.cpp\n>> @@ -8,7 +8,9 @@\n>>   #include \"utils.h\"\n>>   \n>>   #include <string.h>\n>> +#ifdef HAVE_SYS_AUXV_H\n>>   #include <sys/auxv.h>\n>> +#endif\n>>   \n>>   /**\n>>    * \\file utils.h\n>> @@ -57,8 +59,10 @@ const char *basename(const char *path)\n>>    */\n>>   char *secure_getenv(const char *name)\n>>   {\n>> +#ifdef HAVE_GETAUXVAL\n>>   \tif (getauxval(AT_SECURE))\n>>   \t\treturn NULL;\n>> +#endif\n>>   \n> \n> This fall through leaves systems without getauxval() vulnerable to\n> attacks through set-uid programs...\n\nYes, right.\n\n> Would you like to create a new patch based on the above? If not I'll\n> keep this on my todo list for the coming week.\n\nI can do it. I don't know how quickly but I hope before next week.\n\nBest regards\nGiulio\n\n> \n>>   \treturn getenv(name);\n>>   }\n>>\n>","headers":{"Return-Path":"<giulio.benetti@micronovasrl.com>","Received":["from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE53E60004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2019 18:19:12 +0200 (CEST)","from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\tby mail.micronovasrl.com (Postfix) with ESMTP id 8F99FB00E68\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2019 18:19:12 +0200 (CEST)","from mail.micronovasrl.com ([127.0.0.1])\n\tby mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\t(amavisd-new, port 10026)\n\twith ESMTP id GiHR_WFAkJow for <libcamera-devel@lists.libcamera.org>; \n\tTue, 23 Apr 2019 18:19:08 +0200 (CEST)","from [192.168.2.109] (88-149-228-83.v4.ngi.it [88.149.228.83])\n\tby mail.micronovasrl.com (Postfix) with ESMTPSA id 8A292B00AA1;\n\tTue, 23 Apr 2019 18:19:08 +0200 (CEST)"],"Authentication-Results":"mail.micronovasrl.com (amavisd-new); dkim=pass\n\treason=\"pass (just generated, assumed good)\" header.d=micronovasrl.com","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com;\n\th=content-transfer-encoding:content-language:content-type\n\t:content-type:in-reply-to:mime-version:user-agent:date:date\n\t:message-id:from:from:references:to:subject:subject; s=dkim; t=\n\t1556036348; x=1556900349; bh=sHDK3PXyFVEIMhtIwrBcA3E4e13HmT6hmec\n\tIJ6W3eO4=; b=CJ9YAOlMqd1L2j09BPyBqUByzVFw1E2nhApSl07g8G9I1x1LSfu\n\tySizHEllJpREbPR4EUCmbx67VZgyxW7Gve/Wfz7HlDuXssjZqsJMxW6vfaAbQI69\n\tQZu1f1mZHZ20+oy9TQ6kiYE3ly2ZVay80j2E6kJRDwrbT662Tk1AkzWg=","X-Virus-Scanned":"Debian amavisd-new at mail.micronovasrl.com","X-Spam-Flag":"NO","X-Spam-Score":"-2.9","X-Spam-Level":"","X-Spam-Status":"No, score=-2.9 tagged_above=-10 required=4.5\n\ttests=[ALL_TRUSTED=-1, BAYES_00=-1.9]\n\tautolearn=unavailable autolearn_force=no","To":"kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org","References":"<20190423110939.113773-1-giulio.benetti@micronovasrl.com>\n\t<560b09ef-7aaa-3114-9ec8-82fff8676a04@ideasonboard.com>","From":"Giulio Benetti <giulio.benetti@micronovasrl.com>","Message-ID":"<364aa322-85ca-2c17-984e-1e807bd832ca@micronovasrl.com>","Date":"Tue, 23 Apr 2019 18:19:09 +0200","User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101\n\tThunderbird/60.6.1","MIME-Version":"1.0","In-Reply-To":"<560b09ef-7aaa-3114-9ec8-82fff8676a04@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"it","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] meson: fix build when sys/auxv.h and\n\tgetauxval() are not present","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 23 Apr 2019 16:19:13 -0000"}},{"id":6915,"web_url":"https://patchwork.libcamera.org/comment/6915/","msgid":"<20190424110044.12608-1-giulio.benetti@micronovasrl.com>","date":"2019-04-24T11:00:42","subject":"[libcamera-devel] [PATCH 0/2] improve secure_getenv()","submitter":{"id":16,"url":"https://patchwork.libcamera.org/api/people/16/","name":"Giulio Benetti","email":"giulio.benetti@micronovasrl.com"},"content":"Local secure_getenv() at the moment uses getauxval(AT_SECURE), but it's\nnot always present in libc and secure_getenv() instead could be.\n\nCheck if secure_getenv() is available from libc and use it, otherwise\nworkaround it using issetugid().\n\nGiulio Benetti (2):\n  meson: check if secure_getenv() is present\n  libcamera: utils: call secure_getenv() if it exists or workaround with\n    issetugid()\n\n meson.build             | 12 ++++++++++++\n src/libcamera/utils.cpp |  8 ++++++--\n 2 files changed, 18 insertions(+), 2 deletions(-)","headers":{"Return-Path":"<giulio.benetti@micronovasrl.com>","Received":["from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF21660DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Apr 2019 13:00:49 +0200 (CEST)","from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\tby mail.micronovasrl.com (Postfix) with ESMTP id 588A2B014D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Apr 2019 13:00:49 +0200 (CEST)","from mail.micronovasrl.com ([127.0.0.1])\n\tby mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1])\n\t(amavisd-new, port 10026)\n\twith ESMTP id Mp-3Z80ymBXg for <libcamera-devel@lists.libcamera.org>; \n\tWed, 24 Apr 2019 13:00:48 +0200 (CEST)","from ubuntu.localdomain (88-149-228-83.v4.ngi.it [88.149.228.83])\n\tby mail.micronovasrl.com (Postfix) with ESMTPSA id BB0BCB0067F;\n\tWed, 24 Apr 2019 13:00:47 +0200 (CEST)"],"Authentication-Results":"mail.micronovasrl.com (amavisd-new); dkim=pass\n\treason=\"pass (just generated, assumed good)\" header.d=micronovasrl.com","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com;\n\th=references:in-reply-to:x-mailer:message-id:date:date:subject\n\t:subject:to:from:from; s=dkim; t=1556103648; x=1556967649; bh=Vc\n\tEnqagBzd/AeEeW2wub9PfSdvXbqyoJ5h0iyrH5By4=; b=eCWpUXrjIuL58LBUXb\n\t3uPY8P91PVoUjdgKbicG+EyRg8xAtYByVnqlc0VBeJOAyLrubu0UYGS0IVH0B/dx\n\tALb+lgO+z8UiLE1mSM/1fcSmNzEWHEQCiO96VGp2ocUfcQwU3jQjyzMtMMoVWXxT\n\tZ6R+y3qmHVvy+oQBHg3o6XRlc=","X-Virus-Scanned":"Debian amavisd-new at mail.micronovasrl.com","X-Spam-Flag":"NO","X-Spam-Score":"-2.9","X-Spam-Level":"","X-Spam-Status":"No, score=-2.9 tagged_above=-10 required=4.5\n\ttests=[ALL_TRUSTED=-1, BAYES_00=-1.9]\n\tautolearn=unavailable autolearn_force=no","From":"Giulio Benetti <giulio.benetti@micronovasrl.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 24 Apr 2019 13:00:42 +0200","Message-Id":"<20190424110044.12608-1-giulio.benetti@micronovasrl.com>","X-Mailer":"git-send-email 2.17.1","In-Reply-To":"<364aa322-85ca-2c17-984e-1e807bd832ca@micronovasrl.com>","References":"<364aa322-85ca-2c17-984e-1e807bd832ca@micronovasrl.com>","Subject":"[libcamera-devel] [PATCH 0/2] improve secure_getenv()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 24 Apr 2019 11:00:50 -0000"}}]