These are (most likely) only warnings and not severe bugs.
Some of these changes are mostly made to get a clean run of
Coverity without any warnings.
Error found by running Coverity scan
https://bugzilla.redhat.com/show_bug.cgi?id=1025894
Co-Authored-By: Jiří Klimeš <jklimes@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
When freeing one of the collections such as GArray, GPtrArray, GSList,
etc. it is common that the items inside the connections must be
freed/unrefed too.
The previous code often iterated over the collection first with
e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument.
For one, this has the problem, that g_free has a different signature
GDestroyNotify then the expected GFunc. Moreover, this can be
simplified either by setting a clear function
(g_ptr_array_set_clear_func) or by passing the destroy function to the
free function (g_slist_free_full).
Signed-off-by: Thomas Haller <thaller@redhat.com>
Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS
variables, which $(INCLUDES) did not, so this requires some additional
changes.
In most places, I have just gotten rid of the per-target _CPPFLAGS
variables; in directories with a single target, the per-target
variable is unnecessary, and in directories with multiple targets, the
per-target variable is often undesirable, since it forces some files
to be compiled twice, even though there ends up being no difference
between the two files.
There where cases, where TAB was mixed with SPACES. Replace TAB with SPACES.
Additionally, make the script nm-state.py executable
Signed-off-by: Thomas Haller <thaller@redhat.com>
The various need_secrets() implementation do allocate a fresh GPtrArray, but
add static strings to them without dup'ing. Thus callers must _not_ free the
array elements, only the array itself. Adjust documentation and annotations
accordingly.
Also adjust the corresponding comment in the goi-list-connections.py example.
https://bugzilla.gnome.org/show_bug.cgi?id=698175
We had separate checks for glib-2.0, gobject-2.0, gmodule-2.0, and
gio-unix-2.0. It doesn't make sense to link a binary against all 4
because gio-unix-2.0 depends on glib-2.0 and gobject-2.0. Doing this
actually breaks things in unusual circumstances.
Generally, few bits of NM actually just use glib, and not gio. We
might as well coalesce those requirements together, even if it means
in some cases we "overlink". Additionally, I chose for now to fold
gmodule-2.0 in as well, even though many fewer programs need it. The
cost of overlinking is quite small.
The benefit of this is less repeated junk in Makefile.am, as well as
more centralized control over GLib. A followup patch will allow us to
set -DGLIB_VERSION_MIN_REQUIRED in just one place, rather than having
to replicate it 4 times.
The NM configure is still suboptimal - for example, libpolkit-1
depends on gio-2.0, so really we should determine the compiler flags
all in one pass. But it doesn't matter too much for now.
A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the
new mode is passed to wpa_supplicant analogous to adhoc-mode.
The places which need to know the interface mode have been extended to
handle the new mode.
If the configuration does not contain a fixed frequency, a channel is
selected the same way as with adhoc-mode before.
Unfortunately since libnm-glib/libnm-util make heavy use of
GHashTable and GValue, functions that deal with these types
can't be used from Python when using GObject Introspection,
since pygobject can't handle conversion between python types
and GValue/GHashTable very well. You'll likely encounter
assertions like:
ERROR:pygi-argument.c:1755:_pygi_argument_to_object: assertion failed: (g_type_info_get_tag (key_type_info) != GI_TYPE_TAG_VOID)
Aborted
- the first uses dbus-glib and D-Bus "NameOwnerChanged" signal directly
- the second uses GIO's g_bus_watch_name()
- the third uses Qt and QDBusServiceWatcher class
It's always used with a GByteArray anyway, as are most
functions in nm-utils.h. Even better, we can skip the
memcpy since it turns out to be pointless.
Simplifies code internally, and makes it easier for clients as well in
some cases where they want to control what ends up in the resulting
hash and what does not.
Just for consistency, make settings related stuff live under the
org.freedesktop.NetworkManager namespace, rather than its own
org.freedesktop.NetworkManagerSettings namespace. Renames are done for
DBus interface names, DBus object paths, and polkit actions.
Remove the org.freedesktop.NetworkManagerSystemSettings bus name and
have everybody talk to org.freedesktop.NetworkManager. Now that we have
a single settings service that's embedded in the main daemon, we don't
need separate names anymore.
* examples/python/systray/eggtrayicon.c, gnome/applet/eggtrayicon.c,
gnome/applet/passphrase-dialog.c, gnome/applet/vpn-password-dialog.c,
src/NetworkManager.c: Include <glib/gi18n.h> and not <libintl.h>.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1760 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* panel-applet/menu-info.c: change from bold text to light
colored, may cause problems with some themes, i've tested a lot
and they seem fine.
* panel-applet/NMWirelessApplet.c: fix strength tooltip
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@288 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* initscript/Debian/.cvsignore:
* initscript/Slackware/.cvsignore:
Added new cvsignores for Makefile, Makefile.in
* test/.cvsignore:
Added nmtestdevices
* src/NetworkManagerDevice.c:
* src/NetworkManager.c:
Updated the wireless/wired HAL device strings from net.ethernet to
net.80203 or net.80211 depending on wired or wireless respectively
Should probably update the configure.in to ask for the correct HAL
version now.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@168 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* examples/python/NetworkManager.py:
s/Quality/Strength/
* examples/python/systray/network_tray.py:
Lots of little changes and fixes. been rotting for a while so I
figured I'd finally sync them all with CVS
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@166 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* examples/python/systray/network_tray.py
(network_tray.sort_networks):
Added support for having wireless always scanning
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@141 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* examples/python/NetworkManager.py:
added CONNECTED, CONNECTING, and DISCONNECTED states
added methods to return number of devices of a single type
* examples/python/systray/network_tray.py:
did some tweaks to get the menu looking near what it is supposed
to look like. Also did a Airo card hack to make it show the
correct AP quality
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@134 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* examples/python/NetworkManager.py:
added convience functions has_wired_device and has_wireless_device
* examples/python/systray/network_tray.py:
cleaned up a bunch of cruft, added support for listing wireless
networks just like the real applet. This is probably all I'm
going to work on this applet from now on.
TODO: add support for actually changing networks and devices
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@111 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* examples/python/NetworkManager.py (NetworkManager.get_device):
changed "nm.networks" into a dict from a list so I can store all
the cool information about networks in there
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@109 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* examples/python/NetworkManager.py:
Bug fixes to the code so we get all the device information
that we need in get_device()
* examples/python/NMTester.py:
Fixed _print_device_list to print_device_list
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@107 4912f4e0-d625-0410-9fb7-b9a5a253dbdc