After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701820 - dispatcher scripts do not get DNS information
dispatcher scripts do not get DNS information
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: 701824
 
 
Reported: 2013-06-07 21:23 UTC by David Woodhouse
Modified: 2013-07-09 14:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for dispatcher to expose IP4/6 domains (1.72 KB, patch)
2013-06-21 14:33 UTC, Tomas Hozza
none Details | Review
Fix for dispatcher to expose IP4/6 domains (1.84 KB, patch)
2013-06-21 19:21 UTC, Tomas Hozza
none Details | Review

Description David Woodhouse 2013-06-07 21:23:25 UTC
When I bring up a VPN, the VPN server gives me the DNS search domain to use.

A dispatcher script doesn't seem to have any way to access this information.
Comment 1 Tomas Hozza 2013-06-17 12:25:57 UTC
Also information about internal DNS servers from the VPN server is missing.
Comment 2 Tomas Hozza 2013-06-21 14:33:18 UTC
Created attachment 247446 [details] [review]
Fix for dispatcher to expose IP4/6 domains

Fix for NM dispatcher to expose IPx_DOMAINS environment variable to the script.
The functionality was already there, but broken.
Comment 3 Pavel Simerda 2013-06-21 15:26:00 UTC
Review of attachment 247446 [details] [review]:

Looks good.
Comment 4 Dan Williams 2013-06-21 15:45:10 UTC
Looks good, but we should also have a comment here.  In the core daemon, the NMIP4Config and NMIP6Config objects which get converted to hash tables to send over D-Bus actually *do* use the DBUS_TYPE_G_ARRAY_OF_STRING type, but when de-marshalling that dbus-glib apparently converts it to G_TYPE_STRV on the receive side.  That was likely the source of my original mistake when rewriting this part of the dispatcher.

Also, could we warn about this?  Something like:

if (!val)
    return items;

g_return_val_if_fail (G_VALUE_HOLDS (val, G_TYPE_STRV), items);

should do the trick, that way at least we'll log mistaken argument types.
Comment 5 Tomas Hozza 2013-06-21 19:21:43 UTC
Created attachment 247487 [details] [review]
Fix for dispatcher to expose IP4/6 domains

New version with logging if "val" doesn't hold G_TYPE_STRV type.
Comment 6 Tomas Hozza 2013-06-21 19:23:56 UTC
(In reply to comment #4)
> Also, could we warn about this?  Something like:
> 
> if (!val)
>     return items;
> 
> g_return_val_if_fail (G_VALUE_HOLDS (val, G_TYPE_STRV), items);
> 
> should do the trick, that way at least we'll log mistaken argument types.

I agree. It would prevent errors like this, that are not so obvious.
Comment 7 Pavel Simerda 2013-06-21 20:25:02 UTC
Review of attachment 247487 [details] [review]:

Looks ok.
Comment 8 Pavel Simerda 2013-06-21 20:25:02 UTC
Review of attachment 247487 [details] [review]:

Looks ok.
Comment 9 Dan Williams 2013-06-21 22:08:43 UTC
Pushed.
Comment 10 David Woodhouse 2013-07-02 20:36:28 UTC
For 0.9.8 too please?
Comment 11 Jiri Klimes 2013-07-09 14:04:38 UTC
Pushed to nm-0-9-8:
c068709 dispatcher: fix tests after 42577c5269fdf4e9bea442eb96fcba7f8403bda5
42577c5 dispatcher: expose domains in IP4/6 config (bgo #701820)
65edeb9 dispatcher: publish vpn_ip6_config

Note that latest Fedora 19 build (NetworkManager-0.9.8.2-7.fc19) contains the patches:
http://koji.fedoraproject.org/koji/buildinfo?buildID=431415