GNOME Bugzilla – Bug 701820
dispatcher scripts do not get DNS information
Last modified: 2013-07-09 14:04:38 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.
Also information about internal DNS servers from the VPN server is missing.
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.
Review of attachment 247446 [details] [review]: Looks good.
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.
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.
(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.
Review of attachment 247487 [details] [review]: Looks ok.
Pushed.
For 0.9.8 too please?
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