mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 04:50:30 +01:00
2007-08-12 Dan Williams <dcbw@redhat.com>
* callouts/nm-dhcp-client-action.c - (build_message): ignore non-DHCP-related environment variables git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2665 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
ff4c26f965
commit
882a532b08
2 changed files with 17 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2007-08-12 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* callouts/nm-dhcp-client-action.c
|
||||
- (build_message): ignore non-DHCP-related environment variables
|
||||
|
||||
2007-08-12 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* Makefile.am
|
||||
|
|
|
|||
|
|
@ -176,11 +176,14 @@ dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict,
|
|||
}
|
||||
|
||||
|
||||
const char ** ignore[] = {"PATH", "SHLVL", "_", "PWD", "dhc_dbus", NULL};
|
||||
|
||||
dbus_bool_t
|
||||
build_message (DBusMessage * message)
|
||||
{
|
||||
char ** env = NULL;
|
||||
char ** item;
|
||||
char ** p;
|
||||
dbus_bool_t success = FALSE;
|
||||
DBusMessageIter iter, iter_dict;
|
||||
|
||||
|
|
@ -191,8 +194,17 @@ build_message (DBusMessage * message)
|
|||
/* List environment and format for dbus dict */
|
||||
env = g_listenv ();
|
||||
for (item = env; *item; item++) {
|
||||
gboolean ignore_item = FALSE;
|
||||
const char * val = g_getenv (*item);
|
||||
|
||||
/* Ignore non-DCHP-related environment variables */
|
||||
for (p = (char **) ignore; *p && !ignore_item; p++) {
|
||||
if (strncmp (*item, *p, strlen (*p)) == 0)
|
||||
ignore_item = TRUE;
|
||||
}
|
||||
if (ignore_item)
|
||||
continue;
|
||||
|
||||
/* Value passed as a byte array rather than a string, because there are
|
||||
* no character encoding guarantees with DHCP, and D-Bus requires
|
||||
* strings to be UTF-8.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue