<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/nmcli/agent.c, branch 1.41.1-dev</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>format: reformat source tree with clang-format 13.0</title>
<updated>2021-11-29T09:31:09+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-11-09T12:28:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=615221a99cdd5059b2632cba923bc04c92165dbc'/>
<id>615221a99cdd5059b2632cba923bc04c92165dbc</id>
<content type='text'>
We use clang-format for automatic formatting of our source files.
Since clang-format is actively maintained software, the actual
formatting depends on the used version of clang-format. That is
unfortunate and painful, but really unavoidable unless clang-format
would be strictly bug-compatible.

So the version that we must use is from the current Fedora release, which
is also tested by our gitlab-ci. Previously, we were using Fedora 34 with
clang-tools-extra-12.0.1-1.fc34.x86_64.

As Fedora 35 comes along, we need to update our formatting as Fedora 35
comes with version "13.0.0~rc1-1.fc35".
An alternative would be to freeze on version 12, but that has different
problems (like, it's cumbersome to rebuild clang 12 on Fedora 35 and it
would be cumbersome for our developers which are on Fedora 35 to use a
clang that they cannot easily install).

The (differently painful) solution is to reformat from time to time, as we
switch to a new Fedora (and thus clang) version.
Usually we would expect that such a reformatting brings minor changes.
But this time, the changes are huge. That is mentioned in the release
notes [1] as

  Makes PointerAligment: Right working with AlignConsecutiveDeclarations. (Fixes https://llvm.org/PR27353)

[1] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We use clang-format for automatic formatting of our source files.
Since clang-format is actively maintained software, the actual
formatting depends on the used version of clang-format. That is
unfortunate and painful, but really unavoidable unless clang-format
would be strictly bug-compatible.

So the version that we must use is from the current Fedora release, which
is also tested by our gitlab-ci. Previously, we were using Fedora 34 with
clang-tools-extra-12.0.1-1.fc34.x86_64.

As Fedora 35 comes along, we need to update our formatting as Fedora 35
comes with version "13.0.0~rc1-1.fc35".
An alternative would be to freeze on version 12, but that has different
problems (like, it's cumbersome to rebuild clang 12 on Fedora 35 and it
would be cumbersome for our developers which are on Fedora 35 to use a
clang that they cannot easily install).

The (differently painful) solution is to reformat from time to time, as we
switch to a new Fedora (and thus clang) version.
Usually we would expect that such a reformatting brings minor changes.
But this time, the changes are huge. That is mentioned in the release
notes [1] as

  Makes PointerAligment: Right working with AlignConsecutiveDeclarations. (Fixes https://llvm.org/PR27353)

[1] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
</pre>
</div>
</content>
</entry>
<entry>
<title>all: rename nm_utils_strdup_reset*() to nm_strdup_reset*()</title>
<updated>2021-08-02T07:26:47+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-07-30T07:04:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=4ac66a421544bb723cf230f2be80ba179899531b'/>
<id>4ac66a421544bb723cf230f2be80ba179899531b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: fix leak of text for libreadline</title>
<updated>2021-07-29T13:02:24+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-07-29T12:31:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=72433a10f4e3e66d39ef9480957a7528d8228e5c'/>
<id>72433a10f4e3e66d39ef9480957a7528d8228e5c</id>
<content type='text'>
Coverity warns about this:

    Error: RESOURCE_LEAK (CWE-772):
    NetworkManager-1.32.4/src/nmcli/agent.c:87: alloc_fn: Storage is returned from allocation function "g_strdup".
    NetworkManager-1.32.4/src/nmcli/agent.c:87: var_assign: Assigning: "pre_input_deftext" = storage returned from "g_strdup(secret-&gt;value)".
    NetworkManager-1.32.4/src/nmcli/agent.c:87: overwrite_var: Overwriting "pre_input_deftext" in "pre_input_deftext = g_strdup(secret-&gt;value)" leaks the storage that "pre_input_deftext" points to.
    #   85|               /* Prefill the password if we have it. */
    #   86|               rl_startup_hook   = set_deftext;
    #   87|-&gt;             pre_input_deftext = g_strdup(secret-&gt;value);
    #   88|           }
    #   89|           if (secret-&gt;no_prompt_entry_id)

    Error: RESOURCE_LEAK (CWE-772):
    NetworkManager-1.32.4/src/nmcli/common.c:712: alloc_fn: Storage is returned from allocation function "g_strdup".
    NetworkManager-1.32.4/src/nmcli/common.c:712: var_assign: Assigning: "nmc_rl_pre_input_deftext" = storage returned from "g_strdup(secret-&gt;value)".
    NetworkManager-1.32.4/src/nmcli/common.c:712: overwrite_var: Overwriting "nmc_rl_pre_input_deftext" in "nmc_rl_pre_input_deftext = g_strdup(secret-&gt;value)" leaks the storage that "nmc_rl_pre_input_deftext" points to.
    #  710|                           /* Prefill the password if we have it. */
    #  711|                           rl_startup_hook          = nmc_rl_set_deftext;
    #  712|-&gt;                         nmc_rl_pre_input_deftext = g_strdup(secret-&gt;value);
    #  713|                       }
    #  714|                   }
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Coverity warns about this:

    Error: RESOURCE_LEAK (CWE-772):
    NetworkManager-1.32.4/src/nmcli/agent.c:87: alloc_fn: Storage is returned from allocation function "g_strdup".
    NetworkManager-1.32.4/src/nmcli/agent.c:87: var_assign: Assigning: "pre_input_deftext" = storage returned from "g_strdup(secret-&gt;value)".
    NetworkManager-1.32.4/src/nmcli/agent.c:87: overwrite_var: Overwriting "pre_input_deftext" in "pre_input_deftext = g_strdup(secret-&gt;value)" leaks the storage that "pre_input_deftext" points to.
    #   85|               /* Prefill the password if we have it. */
    #   86|               rl_startup_hook   = set_deftext;
    #   87|-&gt;             pre_input_deftext = g_strdup(secret-&gt;value);
    #   88|           }
    #   89|           if (secret-&gt;no_prompt_entry_id)

    Error: RESOURCE_LEAK (CWE-772):
    NetworkManager-1.32.4/src/nmcli/common.c:712: alloc_fn: Storage is returned from allocation function "g_strdup".
    NetworkManager-1.32.4/src/nmcli/common.c:712: var_assign: Assigning: "nmc_rl_pre_input_deftext" = storage returned from "g_strdup(secret-&gt;value)".
    NetworkManager-1.32.4/src/nmcli/common.c:712: overwrite_var: Overwriting "nmc_rl_pre_input_deftext" in "nmc_rl_pre_input_deftext = g_strdup(secret-&gt;value)" leaks the storage that "nmc_rl_pre_input_deftext" points to.
    #  710|                           /* Prefill the password if we have it. */
    #  711|                           rl_startup_hook          = nmc_rl_set_deftext;
    #  712|-&gt;                         nmc_rl_pre_input_deftext = g_strdup(secret-&gt;value);
    #  713|                       }
    #  714|                   }
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Provide optional support for libedit instead of readline</title>
<updated>2021-07-14T15:16:45+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>lukma@denx.de</email>
</author>
<published>2021-07-02T08:30:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=d1dad6ae27e05df2c580d81ced808f81498a92eb'/>
<id>d1dad6ae27e05df2c580d81ced808f81498a92eb</id>
<content type='text'>
The libreadline starting from version 6 is licensed as GPLv3. For some
use cases it is not acceptable to use this license.

In the NetworkManager the libreadline is used by nmcli.
This change allows using libedit instead of libreadline.

Following adjustments were made:
1. The history_set_history_state() is not supported in the libedit.
   Instead, the where_history() with remove_history() were used to remove
   the history content if needed.

2. rl_complete_with_tilde_expansion - it is the binary flag used only
   when one wants to have the expansion support. The libedit is not
   supporting and hence exporting this flag.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The libreadline starting from version 6 is licensed as GPLv3. For some
use cases it is not acceptable to use this license.

In the NetworkManager the libreadline is used by nmcli.
This change allows using libedit instead of libreadline.

Following adjustments were made:
1. The history_set_history_state() is not supported in the libedit.
   Instead, the where_history() with remove_history() were used to remove
   the history content if needed.

2. rl_complete_with_tilde_expansion - it is the binary flag used only
   when one wants to have the expansion support. The libedit is not
   supporting and hence exporting this flag.
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Fix for rl_startup_hook function signatures mismatch (-lreadline vs -ledit)</title>
<updated>2021-07-14T15:16:45+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>lukma@denx.de</email>
</author>
<published>2021-06-30T12:42:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=f47d55fc66bb4873d14d37d77f651ab271637c1c'/>
<id>f47d55fc66bb4873d14d37d77f651ab271637c1c</id>
<content type='text'>
The rl_startup_hook function has different prototype in libreadline and
in the libedit.

To fix this issue, arguments of hook function has been wrapped to C
preprocessor macro and properly adjusted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The rl_startup_hook function has different prototype in libreadline and
in the libedit.

To fix this issue, arguments of hook function has been wrapped to C
preprocessor macro and properly adjusted.
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: move from "clients/cli/" to "src/nmcli/"</title>
<updated>2021-03-15T16:10:54+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-03-14T08:26:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=61f99307c6ce495be4c9c8d326665ccbd019f4e8'/>
<id>61f99307c6ce495be4c9c8d326665ccbd019f4e8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
