<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/nmcli/common.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>nmcli: move an assignment down to where the value needed</title>
<updated>2022-07-29T11:07:38+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2022-07-28T22:03:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=d3d1cd2b3eeee3ff2959cc0eb07d720263db6464'/>
<id>d3d1cd2b3eeee3ff2959cc0eb07d720263db6464</id>
<content type='text'>
It's happier there. No change in behavior.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's happier there. No change in behavior.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
</pre>
</div>
</content>
</entry>
<entry>
<title>nmcli: do not assume active connection has a settings connection</title>
<updated>2022-07-29T11:07:34+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2022-07-28T22:03:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a3ce5aa50ee0c64ff1488a56c8dbb8affdb1fc48'/>
<id>a3ce5aa50ee0c64ff1488a56c8dbb8affdb1fc48</id>
<content type='text'>
The reproducer for another problem tripped an assertion failure:

  $ nmcli con del act-conn
  Connection 'act-conn' (...) successfully deleted.
  $ nmcli con down another-conn

  (process:94552): nm-CRITICAL **: 17:07:21.170: ((src/libnm-client-impl/nm-remote-connection.c:593)): assertion '&lt;dropped&gt;' failed
  Connection 'another-conn' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
  $

What happens is that the second invocation, when resolving the
connection name into a NMRemoteConnection object, assumes an active
connection has a settings connection.

This assumption is likely to be wrong immediately after deleting a
connection was active, before giving the active connection enough time
to fully deactivate.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The reproducer for another problem tripped an assertion failure:

  $ nmcli con del act-conn
  Connection 'act-conn' (...) successfully deleted.
  $ nmcli con down another-conn

  (process:94552): nm-CRITICAL **: 17:07:21.170: ((src/libnm-client-impl/nm-remote-connection.c:593)): assertion '&lt;dropped&gt;' failed
  Connection 'another-conn' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
  $

What happens is that the second invocation, when resolving the
connection name into a NMRemoteConnection object, assumes an active
connection has a settings connection.

This assumption is likely to be wrong immediately after deleting a
connection was active, before giving the active connection enough time
to fully deactivate.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
</pre>
</div>
</content>
</entry>
<entry>
<title>all: reformat with clang-format (clang-tools-extra-14.0.0-1.fc36) and update gitlab-ci to f36</title>
<updated>2022-07-06T09:06:53+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-05-28T16:11:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=d8a4b3bec28c48b3b9f2ed7d499922376a2e05c3'/>
<id>d8a4b3bec28c48b3b9f2ed7d499922376a2e05c3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>nmcli: be less insistant on exiting when readline() gets no input</title>
<updated>2022-06-15T10:13:26+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2022-05-04T07:20:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=47eaf963e31dca8e82d6d9c9454c000528fe5fa7'/>
<id>47eaf963e31dca8e82d6d9c9454c000528fe5fa7</id>
<content type='text'>
When the input ends, we indeed eventually want to shut down.

Nevertheless, it might be that we terminated the input *because* we're
already shutting down and want do do our cleanup. Let's not take the
shortcut to nmc_exit() in case the main loop is no longer running.

This doesn't affect existing uses of nmc_readline(), but will be useful
in a future patch.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the input ends, we indeed eventually want to shut down.

Nevertheless, it might be that we terminated the input *because* we're
already shutting down and want do do our cleanup. Let's not take the
shortcut to nmc_exit() in case the main loop is no longer running.

This doesn't affect existing uses of nmc_readline(), but will be useful
in a future patch.
</pre>
</div>
</content>
</entry>
<entry>
<title>nmcli: add --offline option for "add" and "modify"</title>
<updated>2022-04-19T12:12:42+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2022-04-05T17:47:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=6fa1323ce55f93ba61401bbcbb85f10dc6c2d142'/>
<id>6fa1323ce55f93ba61401bbcbb85f10dc6c2d142</id>
<content type='text'>
This adds a global "--offline" option and allows its use with "add" and
"modify" commands. The "add" looks like this:

  $ nmcli --offline conn add type ethernet ens3 ipv4.dns 192.168.1.1 \
      &gt;output.nmconnection

The "modify" is essentially implementing what's been suggested by
Beniamino in bugzilla ticked (referred to below):

  $ nmcli --offline connection modify ens3 ipv4.dns 192.168.1.1 \
      &lt;input.nmconnection &gt;output.nmconnection

Other commands don't support the argument at the moment:

  $ nmcli --offline c up ens3
  Error: 'up' command doesn't support --offline mode.

https://bugzilla.redhat.com/show_bug.cgi?id=1361145
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a global "--offline" option and allows its use with "add" and
"modify" commands. The "add" looks like this:

  $ nmcli --offline conn add type ethernet ens3 ipv4.dns 192.168.1.1 \
      &gt;output.nmconnection

The "modify" is essentially implementing what's been suggested by
Beniamino in bugzilla ticked (referred to below):

  $ nmcli --offline connection modify ens3 ipv4.dns 192.168.1.1 \
      &lt;input.nmconnection &gt;output.nmconnection

Other commands don't support the argument at the moment:

  $ nmcli --offline c up ens3
  Error: 'up' command doesn't support --offline mode.

https://bugzilla.redhat.com/show_bug.cgi?id=1361145
</pre>
</div>
</content>
</entry>
<entry>
<title>all: prefer nm wrappers to automatically attach GSource to default context</title>
<updated>2022-03-13T10:59:42+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-03-08T13:31:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=216c46c8816ebc5df2a063f7b22a869ebf07fd56'/>
<id>216c46c8816ebc5df2a063f7b22a869ebf07fd56</id>
<content type='text'>
We often create the source with default priority, no destroy function and
attach it to the default context (g_main_context_default()). For that
case, we have wrapper functions like nm_g_timeout_add_source()
and nm_g_idle_add_source(). Use those.

There should be no change in behavior.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We often create the source with default priority, no destroy function and
attach it to the default context (g_main_context_default()). For that
case, we have wrapper functions like nm_g_timeout_add_source()
and nm_g_idle_add_source(). Use those.

There should be no change in behavior.
</pre>
</div>
</content>
</entry>
<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_strdict_*() to nm_strdict_*()</title>
<updated>2021-08-02T07:26:48+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-07-30T07:15:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=593cb57eb6615d63ee209db6df1b2cca87aed7b7'/>
<id>593cb57eb6615d63ee209db6df1b2cca87aed7b7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>
</feed>
