Skip to content

dbus-daemon: Avoid known options being interpreted as optional arguments

Xin Shi requested to merge Aiknow/dbus:master into master

According to the dbus-daemon specification document: https://dbus.freedesktop.org/doc/dbus-daemon.1.html

Synopsis
dbus-daemon

dbus-daemon [--version ] [--session ] [--system ] [--config-file=FILE] [ --print-address [=DESCRIPTOR]] [ --print-pid [=DESCRIPTOR]] [--fork ] [--nosyslog ] [--syslog ] [--syslog-only ] [--ready-event-handle=value]

When the input "--print-address --print-pid" is provided, it should be handled correctly. However, in the actual program, when prev_arg is determined to be "--print-address", it incorrectly treats "--print-pid" as its argument, resulting in an error. Therefore, the fix involves adjusting the judgement of prev_arg for these two parameters to be delayed. This MR is a response to issue #467 (closed).

Signed-off-by: Xin Shi shixin21@huawei.com

Edited by Xin Shi

Merge request reports