Hello community, here is the log from the commit of package NetworkManager checked in at Sun May 7 16:55:27 CEST 2006. -------- --- NetworkManager/NetworkManager.changes 2006-04-25 20:05:59.000000000 +0200 +++ STABLE/NetworkManager/NetworkManager.changes 2006-05-05 21:33:05.000000000 +0200 @@ -1,0 +2,15 @@ +Tue May 2 16:56:17 CEST 2006 - rml@suse.de + +- Install nm-online utility (start of fix for Novell bug #169632) +- nm-applet: Don't try to convert blank network names to new-style + gconf format +- Enable NM by default if installing for the first time (Novell + bug #169964) +- Write out a YaST-friendly header in resolv.conf (Novell #171488) +- Fix WPA Passphrase entry on big-endian machines (GNOME #336991) +- Enforce sane umask on the daemon (Novell bug #173229) +- Respect dhcp:DHCLIENT_MODIFY_RESOLV_CONF, not + config:MODIFY_RESOLV_CONF_DYNAMICALLY, when deciding whether to + write out an updated /etc/resolv.conf (Novell bug #169858) + +------------------------------------------------------------------- New: ---- nm-resolv-conf-header-rml.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ NetworkManager.spec ++++++ --- /var/tmp/diff_new_pack.PkxrPJ/_old 2006-05-07 16:55:11.000000000 +0200 +++ /var/tmp/diff_new_pack.PkxrPJ/_new 2006-05-07 16:55:11.000000000 +0200 @@ -31,18 +31,19 @@ URL: http://www.gnome.org/projects/NetworkManager/ Autoreqprov: on Version: 0.6.2 -Release: 19 +Release: 24 Summary: Network Link Manager and User Applications Source0: NetworkManager-%{version}.tar.gz Source1: nm-icons.tar.gz Source2: nfs -Patch0: nm-make-wireless-menu-item-inactive-rml.patch -Patch1: nm-configure-networking-rml.patch -Patch2: nm-never-restart-nm-applet-rml.patch -Patch3: nm-madwifi-strength-rml.patch -Patch4: nm-wireless-driver-workarounds-rml.patch -Patch5: nm-debug-wpa-less-rml.patch -Patch6: nm-0.6-branch.patch +Patch0: nm-0.6-branch.patch +Patch1: nm-make-wireless-menu-item-inactive-rml.patch +Patch2: nm-configure-networking-rml.patch +Patch3: nm-never-restart-nm-applet-rml.patch +Patch4: nm-madwifi-strength-rml.patch +Patch5: nm-wireless-driver-workarounds-rml.patch +Patch6: nm-debug-wpa-less-rml.patch +Patch7: nm-resolv-conf-header-rml.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: %{name}-client Requires: wireless-tools >= %{wireless_version} @@ -139,13 +140,14 @@ %prep %setup -b 1 -%patch0 -p0 +%patch0 -p1 %patch1 -p0 %patch2 -p0 %patch3 -p0 %patch4 -p0 %patch5 -p0 -%patch6 -p1 +%patch6 -p0 +%patch7 -p0 %build sed -i s/" --sm-disable"// nm-applet.desktop @@ -171,6 +173,7 @@ %find_lang %{name} cp -r ../nm-icons/* $RPM_BUILD_ROOT%{gnome_datadir}/icons/hicolor/ cp test/nm-tool $RPM_BUILD_ROOT%{_bindir}/ +cp test/nm-online $RPM_BUILD_ROOT%{_bindir}/ cp %{S:2} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/ %clean @@ -178,6 +181,12 @@ %post %run_ldconfig +if [ "$1" = 1 ]; then + if grep "network_manager.*always" /etc/YaST2/ProductFeatures; then + sed -i '/^NETWORKMANAGER=.*no/s/no/yes/' /etc/sysconfig/network/config + sed -i '/^NM_DISPATCHER=.*no/s/no/yes/' /etc/sysconfig/network/config + fi +fi %postun %run_ldconfig @@ -196,6 +205,7 @@ %attr(0755,root,root) %{_sbindir}/NetworkManager %attr(0755,root,root) %{_sbindir}/NetworkManagerDispatcher %attr(0755,root,root) %{_bindir}/nm-tool +%attr(0755,root,root) %{_bindir}/nm-online %attr(0755,root,root) %{_libdir}/nm-crash-logger %{_libdir}/libnm-util.so.0 %{_libdir}/libnm-util.so.0.0.0 @@ -248,6 +258,18 @@ %{_libdir}/libnm_glib.so.0.0.0 %changelog -n NetworkManager +* Tue May 02 2006 - rml@suse.de +- Install nm-online utility (start of fix for Novell bug #169632) +- nm-applet: Don't try to convert blank network names to new-style + gconf format +- Enable NM by default if installing for the first time (Novell + bug #169964) +- Write out a YaST-friendly header in resolv.conf (Novell #171488) +- Fix WPA Passphrase entry on big-endian machines (GNOME #336991) +- Enforce sane umask on the daemon (Novell bug #173229) +- Respect dhcp:DHCLIENT_MODIFY_RESOLV_CONF, not + config:MODIFY_RESOLV_CONF_DYNAMICALLY, when deciding whether to + write out an updated /etc/resolv.conf (Novell bug #169858) * Tue Apr 25 2006 - rml@suse.de - Fix "shared/restricted" key mode (Novell bug #168250) * Fri Apr 21 2006 - rml@suse.de ++++++ nm-0.6-branch.patch ++++++ --- /var/tmp/diff_new_pack.PkxrPJ/_old 2006-05-07 16:55:11.000000000 +0200 +++ /var/tmp/diff_new_pack.PkxrPJ/_new 2006-05-07 16:55:12.000000000 +0200 @@ -1,12 +1,15 @@ NETWORKMANAGER_0_6_2_RELEASE to NETWORKMANAGER_0_6_0_RELEASE - ChangeLog | 135 ++++++++ + ChangeLog | 190 ++++++++++++ NEWS | 5 configure.in | 11 + gnome/applet/applet-compat.c | 2 gnome/applet/applet-dbus-devices.c | 2 gnome/applet/applet-dbus-info.c | 12 gnome/applet/applet.c | 87 ----- gnome/applet/applet.glade | 60 +-- + gnome/applet/passphrase-dialog.c | 4 + gnome/libnm_glib/libnm_glib.c | 25 + gnome/vpn-properties/Makefile.am | 6 gnome/vpn-properties/clipboard.c | 74 ++++ gnome/vpn-properties/clipboard.h | 6 @@ -19,6 +22,7 @@ initscript/Slackware/rc.networkmanager | 66 ---- initscript/Slackware/rc.networkmanager-dispatcher.in | 99 ++++++ initscript/Slackware/rc.networkmanager.in | 99 ++++++ + src/NetworkManager.c | 7 src/NetworkManagerAPList.c | 15 src/NetworkManagerAPList.h | 4 src/NetworkManagerDbus.c | 8 @@ -27,22 +31,80 @@ src/NetworkManagerSystem.c | 291 +++++++++---------- src/NetworkManagerSystem.h | 2 src/backends/Makefile.am | 4 - src/backends/NetworkManagerSuSE.c | 11 + src/backends/NetworkManagerSuSE.c | 13 src/dhcp-manager/nm-dhcp-manager.c | 7 src/nm-ap-security-wep.c | 15 src/nm-dbus-nm.c | 5 src/nm-device-802-11-wireless.c | 4 + src/nm-device.c | 33 -- src/nm-ip4-config.c | 30 + src/nm-ip4-config.h | 5 src/nm-netlink-monitor.c | 4 src/vpn-manager/nm-vpn-service.c | 13 + test/Makefile.am | 5 + test/nm-online.c | 140 +++++++++ test/nm-tool.c | 4 - 37 files changed, 870 insertions(+), 381 deletions(-) + 44 files changed, 1112 insertions(+), 412 deletions(-) diff -urN NetworkManager-0.6.2/ChangeLog NetworkManager/ChangeLog --- NetworkManager-0.6.2/ChangeLog 2006-03-27 11:05:17.000000000 -0500 -+++ NetworkManager/ChangeLog 2006-04-25 13:57:33.000000000 -0400 -@@ -1,3 +1,138 @@ ++++ NetworkManager/ChangeLog 2006-05-05 15:32:36.000000000 -0400 +@@ -1,3 +1,193 @@ ++2006-05-05 Robert Love <rml@novell.com> ++ ++ * src/NetworkManager.c: Set the umask to 0022 when daemonizing, in case ++ root has a wacky default of its own (or, more common, a user has a ++ bad umask and uses su/sudo to restart NetworkManager). Anything other ++ than 0022 does not do what we want with, for example, resolv.conf. This ++ problem is amplified by our judicious use of fopen(), which uses mode ++ 0666 -- implying that the only way to get the permissions we want is ++ with a umask of 0022. ++ ++2006-05-05 Dan Williams <dcbw@redhat.com> ++ ++ * gnome/libnm_glib/libnm_glib.c ++ - Don't suck CPU when dbus isn't around by scheduling idle handlers ++ to reconnect; instead wait a bit more with each reconnect attempt ++ up to a max of one minute. ++ ++2006-05-04 Ryan Lortie <desrt@desrt.ca> ++ ++ * gnome/applet/passphrase-dialog.c (update_button_cb): Get the SSID of ++ the WirelessNetwork structure using the proper function instead of ++ just casting it directly to (const char *) (gnome.org #336991) ++ ++2006-05-03 Robert Love <rml@novell.com> ++ ++ * src/backends/NetworkManagerSuSE.c: Respect the variable ++ dhcp:DHCLIENT_MODIFY_RESOLV_CONF, not ++ config:MODIFY_RESOLV_CONF_DYNAMICALLY, when deciding whether or not ++ to dynamically update /etc/resolv.conf. ++ ++2006-05-02 Robert Love <rml@novell.com> ++ ++ Patch by Timo Hoenig; ++ * tests/nm-online.c: Print pretty status indicator as timeout winds ++ down. Also fix possible race between DBUS startup and failure ++ return. ++ ++2006-05-01 Robert Love <rml@novell.com> ++ ++ * gnome/applet/applet-compat.c: Warn if the returned escaped ESSID is ++ empty, too. ++ ++2006-04-27 Jeremy Katz <katzj@redhat.com> ++ ++ * src/nm-device.c (discover_device_type): Actually use the hal ++ device type instead of ioctl poking ++ ++2006-04-26 Robert Love <rml@novell.com> ++ ++ * tests/nm-online.c: New file. Simple utility that returns exit status ++ noting whether the connection is offline or online. If offline on ++ start, it waits 30 seconds (or a command-line given value) for an ++ online signal. If it times out, it again returns offline. This is ++ useful for scripts that want to wait for network connections. ++ +2006-04-25 Robert Love <rml@novell.com> + + * src/nm-ap-security-wep.c: Bug fix: We stopped setting the @@ -336,6 +398,18 @@ gtk_widget_show_all (menu); return menu; +diff -urN NetworkManager-0.6.2/gnome/applet/applet-compat.c NetworkManager/gnome/applet/applet-compat.c +--- NetworkManager-0.6.2/gnome/applet/applet-compat.c 2006-02-21 02:02:55.000000000 -0500 ++++ NetworkManager/gnome/applet/applet-compat.c 2006-05-01 14:58:36.000000000 -0400 +@@ -280,7 +280,7 @@ + g_return_if_fail (client != NULL); + g_return_if_fail (essid != NULL); + +- if (!(escaped_network = gconf_escape_key (essid, strlen (essid)))) ++ if (!(escaped_network = gconf_escape_key (essid, strlen (essid))) || strlen (escaped_network) < 0) + { + nm_warning ("%s:%d (%s): couldn't unescape network name '%s'.", + __FILE__, __LINE__, __func__, essid); diff -urN NetworkManager-0.6.2/gnome/applet/applet-dbus-devices.c NetworkManager/gnome/applet/applet-dbus-devices.c --- NetworkManager-0.6.2/gnome/applet/applet-dbus-devices.c 2006-03-10 12:11:13.000000000 -0500 +++ NetworkManager/gnome/applet/applet-dbus-devices.c 2006-04-20 16:40:41.000000000 -0400 @@ -624,6 +698,88 @@ <child> <widget class="GtkLabel" id="wep_passphrase_label"> +diff -urN NetworkManager-0.6.2/gnome/applet/passphrase-dialog.c NetworkManager/gnome/applet/passphrase-dialog.c +--- NetworkManager-0.6.2/gnome/applet/passphrase-dialog.c 2006-02-27 01:26:31.000000000 -0500 ++++ NetworkManager/gnome/applet/passphrase-dialog.c 2006-05-04 16:15:31.000000000 -0400 +@@ -53,6 +53,7 @@ + GladeXML * xml; + WirelessSecurityManager * wsm; + GtkComboBox * security_combo; ++ WirelessNetwork *net; + + g_return_if_fail (dialog != NULL); + xml = get_dialog_xml (GTK_WIDGET (dialog)); +@@ -60,7 +61,8 @@ + wsm = (WirelessSecurityManager *) g_object_get_data (G_OBJECT (dialog), "wireless-security-manager"); + g_return_if_fail (wsm != NULL); + +- if ((ssid = (const char *) g_object_get_data (G_OBJECT (dialog), "network"))) ++ if ((net = g_object_get_data (G_OBJECT (dialog), "network")) && ++ (ssid = wireless_network_get_essid (net))) + { + /* Validate the wireless security choices */ + security_combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "security_combo")); +diff -urN NetworkManager-0.6.2/gnome/libnm_glib/libnm_glib.c NetworkManager/gnome/libnm_glib/libnm_glib.c +--- NetworkManager-0.6.2/gnome/libnm_glib/libnm_glib.c 2006-02-21 01:25:50.000000000 -0500 ++++ NetworkManager/gnome/libnm_glib/libnm_glib.c 2006-05-05 15:14:23.000000000 -0400 +@@ -39,6 +39,7 @@ + GMainLoop * g_main_loop; + DBusConnection * dbus_con; + guint dbus_watcher; ++ guint dbus_watch_interval; + gboolean thread_done; + gboolean thread_inited; + +@@ -347,14 +348,29 @@ + + g_return_val_if_fail (ctx != NULL, FALSE); + ++ ctx->dbus_watcher = 0; ++ + if (!ctx->dbus_con) + ctx->dbus_con = libnm_glib_dbus_init ((gpointer)ctx, ctx->g_main_ctx); + + if (ctx->dbus_con) +- return (FALSE); /* Don't reschedule ourselves if we have a connection to dbus */ ++ { ++ /* Get NM's state right away after we reconnect */ ++ libnm_glib_get_nm_state (ctx); ++ ctx->dbus_watch_interval = 1000; ++ } ++ else ++ { ++ /* Wait 3 seconds longer each time we fail to reconnect to dbus, ++ * with a maximum wait of one minute. ++ */ ++ ctx->dbus_watch_interval = MIN(ctx->dbus_watch_interval + 3000, 60000); + +- /* Reschule ourselves if we _still_ don't have a connection to dbus */ +- return (TRUE); ++ /* Reschule ourselves if we _still_ don't have a connection to dbus */ ++ libnm_glib_schedule_dbus_watcher (ctx); ++ } ++ ++ return FALSE; + } + + +@@ -372,7 +388,7 @@ + + if (ctx->dbus_watcher == 0) + { +- GSource *source = g_idle_source_new (); ++ GSource * source = g_timeout_source_new (ctx->dbus_watch_interval); + g_source_set_callback (source, libnm_glib_dbus_watcher, (gpointer) ctx, NULL); + ctx->dbus_watcher = g_source_attach (source, ctx->g_main_ctx); + g_source_unref (source); +@@ -453,6 +469,7 @@ + goto error; + if (!(ctx->callbacks_lock = g_mutex_new ())) + goto error; ++ ctx->dbus_watch_interval = 1000; + + return ctx; + diff -urN NetworkManager-0.6.2/gnome/vpn-properties/clipboard.c NetworkManager/gnome/vpn-properties/clipboard.c --- NetworkManager-0.6.2/gnome/vpn-properties/clipboard.c 1969-12-31 19:00:00.000000000 -0500 +++ NetworkManager/gnome/vpn-properties/clipboard.c 2006-04-20 11:13:08.000000000 -0400 @@ -1296,7 +1452,7 @@ $(GTHREAD_CFLAGS) \ diff -urN NetworkManager-0.6.2/src/backends/NetworkManagerSuSE.c NetworkManager/src/backends/NetworkManagerSuSE.c --- NetworkManager-0.6.2/src/backends/NetworkManagerSuSE.c 2006-03-27 10:03:51.000000000 -0500 -+++ NetworkManager/src/backends/NetworkManagerSuSE.c 2006-03-29 14:03:01.000000000 -0500 ++++ NetworkManager/src/backends/NetworkManagerSuSE.c 2006-05-03 15:27:40.000000000 -0400 @@ -354,7 +354,7 @@ NMIP4Config * config; gboolean use_dhcp; @@ -1338,6 +1494,15 @@ if ((sys_data = nm_device_get_system_config_data (dev))) return sys_data->system_disabled; +@@ -1256,7 +1257,7 @@ + if (!file) + goto out_gfree; + +- buf = svGetValue (file, "MODIFY_RESOLV_CONF_DYNAMICALLY"); ++ buf = svGetValue (file, "DHCLIENT_MODIFY_RESOLV_CONF"); + if (!buf) + goto out_close; + @@ -1279,7 +1280,7 @@ * Return a user-provided or system-mandated MTU for this device or zero if * no such MTU is provided. @@ -1432,6 +1597,23 @@ gboolean nm_ap_list_merge_scanned_ap (NMDevice80211Wireless *dev, NMAccessPointList *list, NMAccessPoint *merge_ap); +diff -urN NetworkManager-0.6.2/src/NetworkManager.c NetworkManager/src/NetworkManager.c +--- NetworkManager-0.6.2/src/NetworkManager.c 2006-02-27 15:06:24.000000000 -0500 ++++ NetworkManager/src/NetworkManager.c 2006-05-05 15:32:36.000000000 -0400 +@@ -786,6 +786,13 @@ + write_pidfile (pidfile); + } + ++ /* ++ * Set the umask to 0022, which results in 0666 & ~0022 = 0644. ++ * Otherwise, if root (or an su'ing user) has a wacky umask, we could ++ * write out an unreadable resolv.conf. ++ */ ++ umask (022); ++ + g_type_init (); + if (!g_thread_supported ()) + g_thread_init (NULL); diff -urN NetworkManager-0.6.2/src/NetworkManagerDbus.c NetworkManager/src/NetworkManagerDbus.c --- NetworkManager-0.6.2/src/NetworkManagerDbus.c 2006-02-24 13:59:03.000000000 -0500 +++ NetworkManager/src/NetworkManagerDbus.c 2006-04-06 10:13:19.000000000 -0400 @@ -1927,6 +2109,58 @@ } /* Add the AP to the device's AP list */ +diff -urN NetworkManager-0.6.2/src/nm-device.c NetworkManager/src/nm-device.c +--- NetworkManager-0.6.2/src/nm-device.c 2006-03-21 12:56:34.000000000 -0500 ++++ NetworkManager/src/nm-device.c 2006-05-01 11:14:32.000000000 -0400 +@@ -82,30 +82,17 @@ + * + */ + static NMDeviceType +-discover_device_type (const char *iface) ++discover_device_type (LibHalContext *ctx, const char *udi) + { +- int err = -1; +- int fd; ++ char * category = NULL; + +- g_return_val_if_fail (iface != NULL, FALSE); +- +- if ((fd = iw_sockets_open ()) >= 0) +- { +- char buf[64]; +- +- strncpy (buf, iface, 62); +- buf[63] = '\0'; +- +-#ifdef IOCTL_DEBUG +- nm_info ("%s: About to GET IWNAME", iface); +-#endif +- err = ioctl (fd, SIOCGIWNAME, buf); +-#ifdef IOCTL_DEBUG +- nm_info ("%s: Done with GET IWNAME", iface); +-#endif +- close (fd); +- } +- return err == 0 ? DEVICE_TYPE_802_11_WIRELESS : DEVICE_TYPE_802_3_ETHERNET; ++ if (libhal_device_property_exists (ctx, udi, "info.category", NULL)) ++ category = libhal_device_get_property_string(ctx, udi, "info.category", NULL); ++ if (category && (!strcmp (category, "net.80211"))) ++ return DEVICE_TYPE_802_11_WIRELESS; ++ else if (category && (!strcmp (category, "net.80203"))) ++ return DEVICE_TYPE_802_3_ETHERNET; ++ return DEVICE_TYPE_UNKNOWN; + } + + /* +@@ -152,7 +139,7 @@ + g_return_val_if_fail (strlen (iface) > 0, NULL); + g_return_val_if_fail (app_data != NULL, NULL); + +- type = discover_device_type (iface); ++ type = discover_device_type (app_data->hal_ctx, udi); + switch (type) + { + case DEVICE_TYPE_802_11_WIRELESS: diff -urN NetworkManager-0.6.2/src/nm-ip4-config.c NetworkManager/src/nm-ip4-config.c --- NetworkManager-0.6.2/src/nm-ip4-config.c 2006-03-17 13:39:29.000000000 -0500 +++ NetworkManager/src/nm-ip4-config.c 2006-03-29 14:03:01.000000000 -0500 @@ -2059,6 +2293,170 @@ for (i = 0; i < ip4_dns_len; i++) { +diff -urN NetworkManager-0.6.2/test/Makefile.am NetworkManager/test/Makefile.am +--- NetworkManager-0.6.2/test/Makefile.am 2005-12-29 12:03:35.000000000 -0500 ++++ NetworkManager/test/Makefile.am 2006-04-26 15:09:47.000000000 -0400 +@@ -13,12 +13,15 @@ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" + +-noinst_PROGRAMS = nm-tool nminfotest nmtestdevices libnm_glib_test ++noinst_PROGRAMS = nm-tool nm-online nminfotest nmtestdevices libnm_glib_test + + nm_tool_SOURCES = nm-tool.c + nm_tool_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) $(HAL_LIBS) \ + $(top_builddir)/utils/libnmutils.la + ++nm_online_SOURCES = nm-online.c ++nm_online_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) $(HAL_LIBS) \ ++ $(top_builddir)/utils/libnmutils.la + + nminfotest_SOURCES = nminfotest.c + nminfotest_LDADD = $(DBUS_LIBS) $(GTHREAD_LIBS) \ +diff -urN NetworkManager-0.6.2/test/nm-online.c NetworkManager/test/nm-online.c +--- NetworkManager-0.6.2/test/nm-online.c 1969-12-31 19:00:00.000000000 -0500 ++++ NetworkManager/test/nm-online.c 2006-05-02 10:48:26.000000000 -0400 +@@ -0,0 +1,140 @@ ++/* ++ * nm-online.c - Are we online? ++ * ++ * Return values: ++ * ++ * 0 : already online or connection established within given timeout ++ * 1 : offline or not online within given timeout ++ * 2 : unspecified error ++ * ++ * Robert Love <rml@novell.com> ++ */ ++ ++#define DBUS_API_SUBJECT_TO_CHANGE 1 ++#define PROGRESS_STEPS 15 ++ ++#include <stdio.h> ++#include <stdlib.h> ++ ++#include <glib.h> ++#include <dbus/dbus.h> ++#include <dbus/dbus-glib-lowlevel.h> ++#include <dbus/dbus-glib.h> ++#include <NetworkManager/NetworkManager.h> ++ ++typedef struct ++{ ++ int value; ++ double norm; ++} Timeout; ++ ++static DBusHandlerResult dbus_filter (DBusConnection *connection G_GNUC_UNUSED, ++ DBusMessage *message, ++ void *user_data G_GNUC_UNUSED) ++{ ++ if (!dbus_message_is_signal (message, NM_DBUS_INTERFACE, ++ "DeviceNowActive")) ++ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; ++ exit (0); ++} ++ ++static gboolean check_online (DBusConnection *connection) ++{ ++ DBusMessage *message, *reply; ++ DBusError error; ++ dbus_uint32_t state; ++ ++ message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, ++ NM_DBUS_INTERFACE, "state"); ++ if (!message) ++ exit (2); ++ ++ dbus_error_init (&error); ++ reply = dbus_connection_send_with_reply_and_block (connection, message, ++ -1, &error); ++ dbus_message_unref (message); ++ if (!reply) ++ return FALSE; ++ ++ if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &state, ++ DBUS_TYPE_INVALID)) ++ exit (2); ++ ++ if (state != NM_STATE_CONNECTED) ++ return FALSE; ++ ++ return TRUE; ++} ++ ++static gboolean handle_timeout (gpointer data) ++{ ++ int i = PROGRESS_STEPS; ++ Timeout *timeout = (Timeout *) data; ++ ++ g_print ("\rConnecting"); ++ for (; i > 0; i--) ++ putchar ((timeout->value >= (i * timeout->norm)) ? ' ' : '.'); ++ if (timeout->value) ++ g_print (" %4is", timeout->value); ++ fflush (stdout); ++ ++ timeout->value--; ++ if (timeout->value < 0) ++ exit (1); ++ ++ return TRUE; ++} ++ ++int main (int argc, char *argv[]) ++{ ++ DBusConnection *connection; ++ DBusError error; ++ GMainLoop *loop; ++ Timeout timeout; ++ ++ timeout.value = 30; ++ ++ if (argc == 2) { ++ timeout.value = (int) strtol (argv[1], NULL, 10); ++ if (timeout.value <= 0 || timeout.value > 3600) ++ return 2; ++ } ++ ++ g_type_init (); ++ ++ dbus_error_init (&error); ++ connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error); ++ if (connection == NULL) { ++ dbus_error_free (&error); ++ return 2; ++ } ++ ++ dbus_connection_setup_with_g_main (connection, NULL); ++ ++ if (!dbus_connection_add_filter (connection, dbus_filter, NULL, NULL)) ++ return 2; ++ ++ dbus_bus_add_match (connection, ++ "type='signal'," ++ "interface='" NM_DBUS_INTERFACE "'," ++ "sender='" NM_DBUS_SERVICE "'," ++ "path='" NM_DBUS_PATH "'", &error); ++ if (dbus_error_is_set (&error)) { ++ dbus_error_free (&error); ++ return 2; ++ } ++ ++ /* Check after we setup the filter to ensure that we cannot race. */ ++ if (check_online (connection)) ++ return 0; ++ ++ if (timeout.value) { ++ timeout.norm = (double) timeout.value / (double) PROGRESS_STEPS; ++ g_timeout_add (1000, handle_timeout, &timeout); ++ } ++ ++ loop = g_main_loop_new (NULL, FALSE); ++ g_main_loop_run (loop); ++ ++ return 2; ++} diff -urN NetworkManager-0.6.2/test/nm-tool.c NetworkManager/test/nm-tool.c --- NetworkManager-0.6.2/test/nm-tool.c 2006-03-02 18:01:33.000000000 -0500 +++ NetworkManager/test/nm-tool.c 2006-03-27 12:58:20.000000000 -0500 ++++++ nm-resolv-conf-header-rml.patch ++++++ Index: src/named-manager/nm-named-manager.c =================================================================== RCS file: /cvs/gnome/NetworkManager/src/named-manager/nm-named-manager.c,v retrieving revision 1.11 diff -u -r1.11 nm-named-manager.c --- src/named-manager/nm-named-manager.c 28 Feb 2006 21:41:16 -0000 1.11 +++ src/named-manager/nm-named-manager.c 3 May 2006 17:21:29 -0000 @@ -367,7 +367,15 @@ if ((f = fopen (tmp_resolv_conf, "w")) == NULL) goto lose; - if (fprintf (f, "%s","# generated by NetworkManager, do not edit!\n\n") < 0) + if (fprintf (f, "### BEGIN INFO\n#\n") < 0) + goto lose; + if (fprintf (f, "# Modified_by: NetworkManager\n") < 0) + goto lose; + if (fprintf (f, "# Process: /usr/bin/NetworkManager\n") < 0) + goto lose; + if (fprintf (f, "# Process_id: %d\n", getpid ()) < 0) + goto lose; + if (fprintf (f, "#\n### END INFO\n\n") < 0) goto lose; searches = compute_searches (mgr, config); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de