Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dbus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 247
    • Issues 247
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 34
    • Merge requests 34
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • dbus
  • dbus
  • Issues
  • #351

Closed
Open
Created Nov 22, 2021 by Simon McVittie@smcvOwner

RemoveMatch returns success even if the match rule didn't exist

Reported by Robert Middleton on the mailing list.

Steps to reproduce

  • dbus-monitor &
  • dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.RemoveMatch string:"type='signal'"

Expected result

Error named org.freedesktop.DBus.Error.MatchRuleNotFound, with message The given match rule wasn't found and can't be removed

Actual result

The dbus-daemon sends a successful reply and an error reply

Cause

  /* Send the ack before we remove the rule, since the ack is undone
   * on transaction cancel, but rule removal isn't.
   */
  if (!bus_driver_send_ack_reply (connection, transaction, message, error))
    goto failed;

  matchmaker = bus_connection_get_matchmaker (connection);

  if (!bus_matchmaker_remove_rule_by_value (matchmaker, rule, error))
    goto failed;

The "ack" (successful reply with no arguments) is attached to the transaction even if removing the match rule is going to fail, and is not removed from the transaction on failure (and in fact I don't think we have any way to achieve that).

Assignee
Assign to
Time tracking