)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"82d65053_68ff4c79","updated":"2026-08-28 07:05:56.000000000","message":"This currently doesn\u0027t build at all under CMake.","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"}],"CMakeLists.txt":[{"author":{"_account_id":1000003,"name":"plaisthos","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},"change_message_id":"9c2c5d6f40296d8c301ffb70c8d43d8b60b35446","unresolved":true,"context_lines":[{"line_number":694,"context_line":"            \"test_cryptoapi\""},{"line_number":695,"context_line":"            )"},{"line_number":696,"context_line":"    else ()"},{"line_number":697,"context_line":"        list(APPEND unit_tests"},{"line_number":698,"context_line":"            \"test_close_fds\""},{"line_number":699,"context_line":"            )"},{"line_number":700,"context_line":"    endif ()"}],"source_content_type":"text/x-cmake","patch_set":2,"id":"b7e40bd5_4be40bc2","line":697,"updated":"2026-08-29 19:46:44.000000000","message":"Please do not add a whole unit test suite for a single test. Add the test_close_fds to an existing test suite like misc tests driver do do an #ifdef WIN32 and skip() in there.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"a9818a68d9a9f67d041bc61bc096dc0687aaa2f0","unresolved":true,"context_lines":[{"line_number":696,"context_line":"    else ()"},{"line_number":697,"context_line":"        list(APPEND unit_tests"},{"line_number":698,"context_line":"            \"test_close_fds\""},{"line_number":699,"context_line":"            )"},{"line_number":700,"context_line":"    endif ()"},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"    # MSVC and Apple\u0027s LLVM ld do not support --wrap"}],"source_content_type":"text/x-cmake","patch_set":2,"id":"3ffd533d_2460ca4e","line":699,"updated":"2026-08-29 14:19:58.000000000","message":"This makes it look as if test_close_fds is somehow related to test_cryptoapi. Might be clearer to just put it under a separate `if (NOT WIN32)` block.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"a9818a68d9a9f67d041bc61bc096dc0687aaa2f0","unresolved":true,"context_lines":[{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    if (TARGET test_close_fds)"},{"line_number":851,"context_line":"        target_sources(test_close_fds PRIVATE"},{"line_number":852,"context_line":"            tests/unit_tests/openvpn/mock_get_random.c"},{"line_number":853,"context_line":"            src/compat/close-fds.c"},{"line_number":854,"context_line":"            )"},{"line_number":855,"context_line":"    endif ()"}],"source_content_type":"text/x-cmake","patch_set":2,"id":"4823d90e_d2c1c613","line":852,"updated":"2026-08-29 14:19:58.000000000","message":"Do you need `mock_get_random.c` here? The Automake version doesn\u0027t add it and it seems fine.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"}],"src/compat/close-fds.c":[{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":true,"context_lines":[{"line_number":9,"context_line":" *"},{"line_number":10,"context_line":" *  This program is free software; you can redistribute it and/or modify"},{"line_number":11,"context_line":" *  it under the terms of the GNU General Public License version 2"},{"line_number":12,"context_line":" *  as published by the Free Software Foundation."},{"line_number":13,"context_line":" */"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"#ifdef HAVE_CONFIG_H"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"0e85c547_3db5529f","line":12,"updated":"2026-08-28 07:05:56.000000000","message":"Truncated license text compared to existing files here as well.","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"a9818a68d9a9f67d041bc61bc096dc0687aaa2f0","unresolved":true,"context_lines":[{"line_number":36,"context_line":"{"},{"line_number":37,"context_line":"    closelog();"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"#ifdef HAVE_CLOSE_RANGE"},{"line_number":40,"context_line":"    if (keep \u003e\u003d 3)"},{"line_number":41,"context_line":"    {"},{"line_number":42,"context_line":"        const int lower_closed \u003d keep \u003d\u003d 3 || close_range(3, (unsigned int)keep - 1, 0) \u003d\u003d 0;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"ac18c82a_b964a594","line":39,"updated":"2026-08-29 14:19:58.000000000","message":"I could be wrong (maybe I missed something subtle), but AFAICT this path can never be exercised under the CMake build.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"a9818a68d9a9f67d041bc61bc096dc0687aaa2f0","unresolved":true,"context_lines":[{"line_number":39,"context_line":"#ifdef HAVE_CLOSE_RANGE"},{"line_number":40,"context_line":"    if (keep \u003e\u003d 3)"},{"line_number":41,"context_line":"    {"},{"line_number":42,"context_line":"        const int lower_closed \u003d keep \u003d\u003d 3 || close_range(3, (unsigned int)keep - 1, 0) \u003d\u003d 0;"},{"line_number":43,"context_line":"        if (lower_closed \u0026\u0026 close_range((unsigned int)keep + 1, ~0U, 0) \u003d\u003d 0)"},{"line_number":44,"context_line":"        {"},{"line_number":45,"context_line":"            return;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"3da10afb_ecf791a5","line":42,"updated":"2026-08-29 14:19:58.000000000","message":"This should probably be `bool` instead.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"d33cb8c17c852510e48e6a6cb83492f06716c0fb","unresolved":true,"context_lines":[{"line_number":39,"context_line":"#ifdef HAVE_CLOSE_RANGE"},{"line_number":40,"context_line":"    if (keep \u003e\u003d 3)"},{"line_number":41,"context_line":"    {"},{"line_number":42,"context_line":"        const int lower_closed \u003d keep \u003d\u003d 3 || close_range(3, (unsigned int)keep - 1, 0) \u003d\u003d 0;"},{"line_number":43,"context_line":"        if (lower_closed \u0026\u0026 close_range((unsigned int)keep + 1, ~0U, 0) \u003d\u003d 0)"},{"line_number":44,"context_line":"        {"},{"line_number":45,"context_line":"            return;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"7bc3ef82_ca4ebbb3","line":42,"in_reply_to":"3da10afb_ecf791a5","updated":"2026-08-29 16:37:49.000000000","message":"... and please avoid complex conditional operator constructs with side effects in assignments.  I only had two coffees today and I find this line beyond my C parsing skills right now.\n\nThis looks like we\u0027re calling `close_range()` way too often anyway - figure out the lower boundary in an understandable `if()` clause (or a conditional assignment), then call `close_range( first, last, 0 )`.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"d33cb8c17c852510e48e6a6cb83492f06716c0fb","unresolved":true,"context_lines":[{"line_number":60,"context_line":"    {"},{"line_number":61,"context_line":"        if (i !\u003d keep)"},{"line_number":62,"context_line":"        {"},{"line_number":63,"context_line":"            close((int)i);"},{"line_number":64,"context_line":"        }"},{"line_number":65,"context_line":"    }"},{"line_number":66,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"bb033b37_333e2356","line":63,"updated":"2026-08-29 16:37:49.000000000","message":"if we cast the to-be-closed file descriptor to `(int)` here, using `long` as a loop index is not the right thing to do.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"}],"src/compat/close-fds.h":[{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":true,"context_lines":[{"line_number":10,"context_line":" *  This program is free software; you can redistribute it and/or modify"},{"line_number":11,"context_line":" *  it under the terms of the GNU General Public License version 2"},{"line_number":12,"context_line":" *  as published by the Free Software Foundation."},{"line_number":13,"context_line":" */"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"#ifndef CLOSE_FDS_H"},{"line_number":16,"context_line":"#define CLOSE_FDS_H"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"b5a8e1be_189d30c5","line":13,"updated":"2026-08-28 07:05:56.000000000","message":"The rest of the files have a more comprehensive block of text about the license, we probably want to follow the existing convention.","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":true,"context_lines":[{"line_number":16,"context_line":"#define CLOSE_FDS_H"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"#ifndef _WIN32"},{"line_number":19,"context_line":"void close_fds_except(int keep);"},{"line_number":20,"context_line":"#endif"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"#endif /* CLOSE_FDS_H */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"e7c13955_06de8eed","line":19,"updated":"2026-08-28 07:05:56.000000000","message":"The new function lost all previous (Doxygen) documentation explaining the need for it and what it does.","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"}],"tests/unit_tests/openvpn/Makefile.am":[{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"a9818a68d9a9f67d041bc61bc096dc0687aaa2f0","unresolved":true,"context_lines":[{"line_number":49,"context_line":"endif"},{"line_number":50,"context_line":"check_PROGRAMS \u003d $(test_binaries)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"close_fds_testdriver_CFLAGS \u003d -I$(top_srcdir)/src/compat @TEST_CFLAGS@"},{"line_number":53,"context_line":"close_fds_testdriver_LDFLAGS \u003d @TEST_LDFLAGS@"},{"line_number":54,"context_line":"close_fds_testdriver_SOURCES \u003d test_close_fds.c"},{"line_number":55,"context_line":"close_fds_testdriver_LDADD \u003d $(top_builddir)/src/compat/libcompat.la"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"39623fc0_62c1a8bd","line":52,"updated":"2026-08-29 14:19:58.000000000","message":"This is the only testdriver whose CFLAGS omit `-I$(top_srcdir)/src/openvpn`. That breaks the mbedTLS build.","commit_id":"af724b68aea7ad161492da8aad1cd8a5ff456bd5"}],"tests/unit_tests/openvpn/test_close_fds.c":[{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":true,"context_lines":[{"line_number":9,"context_line":" *"},{"line_number":10,"context_line":" *  This program is free software; you can redistribute it and/or modify"},{"line_number":11,"context_line":" *  it under the terms of the GNU General Public License version 2"},{"line_number":12,"context_line":" *  as published by the Free Software Foundation."},{"line_number":13,"context_line":" */"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"#ifdef HAVE_CONFIG_H"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a7daec1c_2276922f","line":12,"updated":"2026-08-28 07:05:56.000000000","message":"License header doesn\u0027t match the rest of the code in length.","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":true,"context_lines":[{"line_number":33,"context_line":"}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"static int"},{"line_number":36,"context_line":"run_case(int keep_target)"},{"line_number":37,"context_line":"{"},{"line_number":38,"context_line":"    int control[2];"},{"line_number":39,"context_line":"    if (socketpair(AF_UNIX, SOCK_STREAM, 0, control) \u003c 0)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"f95dff6f_c2a250a7","line":36,"updated":"2026-08-28 07:05:56.000000000","message":"The current convention AFAICT is to use cmocka for tests, which this does not.","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"},{"author":{"_account_id":1000053,"name":"razvanc","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"change_message_id":"d8be5a6bd174e415f609f15358faa3aeeb3f9e16","unresolved":true,"context_lines":[{"line_number":106,"context_line":"    return run_case(-1) \u003d\u003d EXIT_SUCCESS \u0026\u0026 run_case(3) \u003d\u003d EXIT_SUCCESS"},{"line_number":107,"context_line":"                   \u0026\u0026 run_case(150) \u003d\u003d EXIT_SUCCESS"},{"line_number":108,"context_line":"               ? EXIT_SUCCESS"},{"line_number":109,"context_line":"               : EXIT_FAILURE;"},{"line_number":110,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"114c5b35_7564e0eb","line":109,"updated":"2026-08-28 07:05:56.000000000","message":"Might we also want to test that fds 0, 1 and 2 survive?","commit_id":"af300510350e2496a17f0e3e07ae22107bb42d5a"}]}
