The existing color code escape sequences required the user to set the
color, write the string, then unset with COLOR_OFF. Instead the macros
can be made to take the string itself and automatically terminate the
color with COLOR_OFF. This makes for much more concise strings.
The generic proxy property display was limited to a width for names/value
which makes the output look nice and uniform, but will cut off any values
which are longer than this limit.
This patch adds some logic to detect this, and continue displaying the
value on the next line.
The width arguments were also updated to be unsigned, which allows checking
the length without a cast.
The dbus proxy code assumes that every interface has a set of
properties registered in a 'proxy_interface_property' structure,
assuming the interface has any properties at all. If the interface
is assumed to have no properties (and no property table) but
actually does, the property table lookup fails but is assumed to
have succeeded and causes a crash.
This caused iwctl to crash after some properties were added to DPP
since the DPP interface previously had no properties.
Now, check that the property table was valid before accessing it. This
should allow properties to be added to new interfaces without crashing
older versions of iwctl.
In non-interactive mode, when a dbus method call returns the process
exits. This is true for all methods except agent requests since e.g.
Connect() call automatically requests credentials and the client must
wait for that to return before exiting. The new daemon interface must
also be treated in the same way and not exit.
Do agent registration as part of agent manager proxy creation.
This ensures that the registration call is made only after the agent
manager’s interface becomes available on the bus.
Add the newly created proxy objects into the queue before the
interface specific initialization logic takes place. This way the new
proxy objects can be used within the initialization procedures.
Previously, the parsing of the OMs objects has been done in one pass,
therefore, the proxy object's dependencies may not have been parsed at the
time when they were looked up for the dependency assignments. Now, the
parsing of the OM objects is done in two passes: 1) Create proxy objects -
one per interface and path, 2) Populate the proxy objects with properties
and assign dependencies. Therefore, we are guaranteed to have the proxy
objects created by the time they are looked up for the dependency
assignments.
In non-interactive mode request the managed object right away and do
not wait for the service to appear. This way client can fail right
away instead of endlessly waiting in non-interactive mode.
In non-interactive mode the agent managers' agent registration callback
precede the actual action command's callback such as 'connect'. iwctl
continues execution until anything else besides the agent registration
callback arrives unless the agent registration has failed.
Previously, agent was registered only for the interactive mode.
This patch enables agent registration in non-interactive mode
taking into consideration the existence of the command-line options.
Previously, on service disappeared event the list of the known
proxy objects was cleared, but pointers to the default entity
per command family wasn’t reset. Reset default entities for
the command families to remove the dead pointers to the deleted
proxy objects.
==1325== Invalid read of size 8
==1325== at 0x4055D4: proxy_interface_is_same (dbus-proxy.c:439)
==1325== by 0x407C28: match_by_partial_name (network.c:220)
==1325== by 0x40547C: proxy_interface_find_all (dbus-proxy.c:424)
==1325== by 0x405592: proxy_property_str_completion (dbus-proxy.c:153)
==1325== by 0x407DA9: network_name_completion (network.c:241)
==1325== by 0x4E596D5: rl_completion_matches (in /usr/lib64/libreadline.so.7.0)
This function now takes an extra argument 'extra_interface'. When
non-NULL, the property match is furthered filtered by checking whether
the proxy_interface on the given path also contains an interface of type
'extra_interface'