| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | | |
nm_g_error_matches() can be inlined and first checks whether the error
argument is not NULL. At least from the keyfile accessor functions, use
this macro, as they are called many times.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Macros preferably behave function-like, for example in that they evaluate
arguments exactly ones. Sometimes, we want to evaluate arguments
lazily, like in NM_IN_SET() or nm_g_set_error_take_lazy(). But it
is almost always undesirable to evaluate an argument more than once.
Fix NM_STR_HAS_PREFIX() for that.
Also, rename the local variable to not use the name "_str",
which may be a common name that the caller would like to use.
|
| |\
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/494
|
| | |
| | |
| | |
| | |
| | | |
lgtm.com says "The value assigned to local variable all_connections is never used".
Just drop the entire statement. It's not right there.
|
| | |
| | |
| | |
| | | |
lgmt.com says "Testing for None should use the is operator".
|
| | |
| | |
| | |
| | | |
lgtm.com flags this as "Except block directly handles BaseException".
|
| | |
| | |
| | |
| | | |
Just to silence the warning on lgtm.com.
|
| | | |
|
| | |
| | |
| | |
| | | |
lgtm.com warns about this.
|
| | | |
|
| | |
| | |
| | |
| | | |
"generate-setting-docs.py"
|
| | |
| | |
| | |
| | | |
It causes a warning on lgtm.com.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
NMConfigDeviceStateData.nm_owned
lgtm.com warns:
int nm_owned:3;
>> Bit field nm_owned of type int should have explicitly unsigned integral, explicitly signed integral, or enumeration type.
So make it a NMTernary instead. It's nicer anyway.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
lgtm.com flags this as "Empty block without comment".
Avoid it.
This code is of course ugly. Much work was already done to
port such occurrences, and more is needed. I won't add a FIXME
comment, because lgtm.com flags those too. :)
|
| | |
| | |
| | |
| | | |
nmcli_editor_tab_completion()
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Static analysis tools flag the use of localtime() because it is not
thread safe. Of course, that was no problem here, but avoiding the
warning is simple.
Also, if we allocate 128 bytes, let strftime use it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
lgtm.com flags this. The check was there to be better safe than sorry.
Also, it seems better to have code that shows what happens instead
of a verbose code comment (or no comment at all). Anyway, avoid the
false positive.
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Defining the name "dispose" breaks
object_class->dispose = dispose;
below.
Fixes: fdba9200c0c0 ('device: avoid coverity warning about unused variable')
|
| |\
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/495
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reported by coverity:
>>> CID 210230: Control flow issues (UNREACHABLE)
>>> This code cannot be reached: "i = 0;".
Fixes: 09e17888f7f0 ('libnm: add mapping functions between string and NMClientPermission enum')
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reported by coverity:
>>> CID 210222: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a pointer that might be "NULL" "f" when calling
"fseek".
Fixes: ac5206aa9c5a ('2007-11-21')
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reported by coverity:
>>> CID 210228: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "dbobj" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Fixes: ce0e898fb476 ('libnm: refactor caching of D-Bus objects in NMClient')
|
| | |
| | |
| | |
| | |
| | | |
For consistency with the rest of the code, prefer g_malloc() over
malloc().
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reported by coverity:
>>> CID 210213 Uninitialized pointer read (UNINIT)
>>> Using uninitialized value iter when calling
_nm_auto_free_variant_iter
Fixes: df1d214b2ea7 ('clients: polkit-agent: implement polkit agent without using libpolkit')
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reported by coverity:
>>> CID 210217: (UNINIT)
>>> Using uninitialized value "identities_gvariant" when calling
"gs_local_variant_unref".
Fixes: df1d214b2ea7 ('clients: polkit-agent: implement polkit agent without using libpolkit')
|
| |\
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/431
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
If the driver is unknown, that doesn't necessarily mean that the match
passes. Instead, the match passes if there is no positive match that
asks for the driver name.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
%NULL means that the string is unknown. The pattern should still match
if there are no positive matches that want to match against the string.
For example, the nm_device_get_driver() might return NULL. If we have
a match.driver setting, we still need to handle that somehow that it
makes sense.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- write_match_setting() never fails. Don't let it return a boolean
error result.
- drop "if (!name || !name[0])" checks. It's not possibly to configure
a name %NULL in NMSettingMatch (without triggering assertions). Also,
an empty name "" is not valid, so we wouldn't expect it. There is one
problem with the way how we concatenate the string list: it uses
spaces as separator, while stripping spaces. That means, in the
currenty format, an empty token "" cannot be expressed. On the other
hand, serializing it would lead to duplicate spaces, that get dropped
during re-read. So the empty name wasn't valid from the start, but it
also cannot be encoded.
- use nm_gstring_add_space_delimiter() and nm_gstring_prepare().
|
| | |
| | |
| | |
| | | |
The default implementation should be good enough. Use it.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Also track the interface_name in a GArray so that
nm_setting_match_get_interface_names() returns a NULL
terminated strv array.
|
| | |
| | |
| | |
| | |
| | |
| | | |
GPtrArray does not support NULL terminating the pointer array. That
makes it cumbersome to use it for tracking a strv array. Add a few
helper functions nm_strvarray_*() that help using a GArray instead.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
nm_setting_match_get_{kernel_command_lines,drivers}()
Otherwise the function is not usable via generated bindings.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Add a new "driver" match option to nm-settings. It allows to disable a
network connection configuration if a pattern is found or is not found
in the device driver name.
|