Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3f440fe
Removed special compile target version
hypfvieh Jul 5, 2026
aa8d144
Addressed some code analysis findings
hypfvieh Jul 5, 2026
7854257
More code review findings
hypfvieh Jul 5, 2026
f59adcc
Regression fixes
hypfvieh Jul 5, 2026
a619a17
More regression fixes
hypfvieh Jul 5, 2026
3922943
Fixed issues when marshalling multi tuple return values
hypfvieh Jul 10, 2026
07ff986
Fixed possible issues with array length and integer casting when reading
hypfvieh Jul 10, 2026
210417a
Fixed interface code generator; Improved testing of generated code
hypfvieh Jul 12, 2026
55f6581
More interface code generator fixes
hypfvieh Jul 12, 2026
7bc5d25
Last interface code generator fixes
hypfvieh Jul 12, 2026
c52c665
Added watchdog to terminate tcp-auth sessions when tcp-session is kept
hypfvieh Jul 17, 2026
0c80fe5
Added bounds for error queue
hypfvieh Jul 17, 2026
5f7a350
Fixed possible leak
hypfvieh Jul 17, 2026
82374ad
Fixed blocking shutdown if shutdown was initiated from signal callback
hypfvieh Jul 17, 2026
3b75597
Fixed possible ArrayIndexOutOfBoundsException when reading dbus cookie;
hypfvieh Jul 17, 2026
03e245e
Merge branch 'master' into claude
hypfvieh Jul 17, 2026
789d8cc
updated readme
hypfvieh Jul 17, 2026
2cf1aaf
updated readme
hypfvieh Jul 17, 2026
3cd8742
Updated documention
hypfvieh Jul 17, 2026
1ecdbe5
Fixed bugs in Dbus matchrule handling
hypfvieh Jul 17, 2026
765fc8e
Fixed SASL FileDescriptor handling
hypfvieh Jul 17, 2026
74de2cb
Fixed checkstyle issues
hypfvieh Jul 17, 2026
028df87
documentation clarification
hypfvieh Jul 17, 2026
26c67b4
Fixed: PropertiesChanged signal was not emitted when using bound
hypfvieh Jul 18, 2026
9f84e0e
Fixed BecomingMonitor handling
hypfvieh Jul 18, 2026
0664f2f
Improved BusAddress parsing
hypfvieh Jul 18, 2026
d983cf4
Added default implementation of DBusObjectManager
hypfvieh Jul 18, 2026
1450971
Fixed: file descriptors could be read beyond limits
hypfvieh Jul 18, 2026
35a9904
Added debug output options to EmbeddedDbusDaemon
hypfvieh Jul 18, 2026
0cfe399
More features for DBus Daemon
hypfvieh Jul 26, 2026
4f04f5a
Added support for tcp-nonce
hypfvieh Jul 26, 2026
e9006d1
Added support for additional bus address parameters
hypfvieh Jul 26, 2026
7b2bbe7
Improved implementation of BusAddress in combination with various
hypfvieh Jul 26, 2026
cf8181c
Added Dbus "Verbose" interface
hypfvieh Jul 27, 2026
ec2b842
Added support for address fallback
hypfvieh Jul 27, 2026
af91ff8
Improved tests
hypfvieh Jul 27, 2026
d59dd42
Updated README
hypfvieh Jul 27, 2026
f93fb24
Addressed sonar findings
hypfvieh Jul 27, 2026
76071ee
More sonar findings: Simplified method
hypfvieh Jul 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ To use file descriptors with dbus-java version 4.x before 4.3.1 you have to do t
When using dbus-java-nativefd, you have to use version 2.x when using dbus-java 4.x/5.x and 1.x if you use dbus-java 3.x.
DBus-java will automatically detect dbus-java-nativefd and will then provide access to file descriptors.

Please note that `dbus-java-nativefd` is a third-party library which is **not** maintained by the dbus-java project.
It relies on platform-specific native (JNI/C) code and is therefore not necessarily portable to every architecture.
For this reason it is intentionally not bundled with dbus-java. Whenever possible, prefer the
`dbus-java-transport-junixsocket` transport, which supports file descriptor passing without any additional dependency.
The `dbus-java-transport-native-unixsocket` transport does not support file descriptor passing at all.

If you are using version 4.3.1 or higher, you may simple switch to `dbus-java-transport-junixsocket` (instead of `dbus-java-transport-jnr-unixsocket` or `dbus-java-transport-native-unixsocket`).
You do this by adding `dbus-java-transport-junixsocket` to your classpath.
Remember to remove the other unixsocket implementations because you are not allowed to have multiple implementations of the same protocol at once.
Expand Down Expand Up @@ -91,6 +97,34 @@ The library will remain open source and MIT licensed and can still be used, fork
- Fixed SASL authentication issue when running in server mode in combination with unix sockets ([#298](https://github.com/hypfvieh/dbus-java/issues/298))
- Fixed various issues with `InterfaceCodeGenerator` ([#302](https://github.com/hypfvieh/dbus-java/issues/302), [#303](https://github.com/hypfvieh/dbus-java/issues/303), [#304], (https://github.com/hypfvieh/dbus-java/issues/304), [#306](https://github.com/hypfvieh/dbus-java/issues/306)
- Refactoring and overhaul of `InterfaceCodeGenerator` to improve code, reduce duplications and allow easier fixing/extending
- Added support for interactive authorization ([#PR313](https://github.com/hypfvieh/dbus-java/issues/313)), thanks to ([unfamiliarS](https://github.com/unfamiliarS)
- **AI assisted improvements** (the following changes were developed with AI assistance):
- Added `Monitoring`/`BecomeMonitor` as a runtime mode: `DBusConnection.becomeMonitor(List<DBusMatchRule>, DBusMonitorHandler)` delivers raw copies of the bus traffic; the `EmbeddedDBusDaemon` now mirrors traffic to monitor connections (eavesdropping intentionally omitted as it is deprecated by the specification)
- Added automatic server-side `ObjectManager` handling: `GetManagedObjects` is answered from the exported sub-tree and `InterfacesAdded`/`InterfacesRemoved` are emitted automatically; opt out with `withManualObjectManager(true)` or export a ready-made one via `exportObjectManager(path)`
- Optionally emit `PropertiesChanged` automatically when a `@DBusBoundProperty` setter is invoked (`withAutoEmitPropertiesChanged(true)`, disabled by default, honours `EmitsChangedSignal`)
- Added the debug/diagnostic interfaces `org.freedesktop.DBus.Debug.Stats` and `org.freedesktop.DBus.Verbose`, offered only by the new opt-in `DebuggableEmbeddedDBusDaemon` (a default daemon behaves like a production reference daemon and reports `UnknownMethod`)
- Declared the `ActivatableServicesChanged` signal, added `ReloadConfig` to the `org.freedesktop.DBus` interface and exposed the bus properties `Features`/`Interfaces` on the embedded daemon
- Fixed several D-Bus match-rule issues: multiple `argN`/`argNpath` constraints are now combined with logical AND, `argNpath` parsing was corrected, the argument index range is validated (0–63) and `path_namespace` now also validates the message path
- Added support for address fallback: the D-Bus specification allows specifying multiple addresses when connecting, which should be tried in order until one is available or all fail. Previously dbus-java only used the first address and ignored the rest; now all are tried as the specification defines (`DBusConnectionBuilder.forAddresses(...)` and `;`-separated address lists)
- `BusAddress` now parses `;`-separated address lists (`parseAll`) and correctly decodes/encodes `%HH` escape sequences
- Added the `nonce-tcp` transport (16-byte nonce handshake); extended the transport SPI with a backward-compatible `ITransportProvider.getSupportedBusTypes()` so a single provider can serve several address schemes
- The TCP transport now honours the `family` (`ipv4`/`ipv6`) and `bind` address parameters (including `bind=*` to bind all interfaces)
- The unix transports now honour the listen-side address parameters `dir`, `tmpdir` and `runtime` (resolved to a concrete socket path/abstract name); introduced a shared `AbstractUnixBusAddress` base for the unix transports
- Fixed file-descriptor negotiation during SASL (`NEGOTIATE_UNIX_FD`/`AGREE_UNIX_FD`), including handling of servers that reject file-descriptor passing
- Hardened message parsing against malformed or malicious wire data: unknown header field codes are now ignored instead of throwing, oversized arrays are rejected before the length is truncated by an `int` cast, and the data offset is included when validating string/signature lengths (previously an `ArrayIndexOutOfBoundsException`/`StringIndexOutOfBoundsException` could tear down the connection)
- Enforce an actual recursion-depth limit when converting wire types to Java types in `Marshalling` (the previous check accidentally used the type count instead of the nesting depth)
- Validate the received `UNIX_FDS` count against the actual number of descriptors, bounds-check file-descriptor indices and guard against excessively nested variants/containers during value extraction
- Remove the empty match-rule queue when `AddMatch` fails, so a later `addSigHandler` re-sends `AddMatch` instead of silently never subscribing
- Disconnect the connection on an unexpected `RuntimeException` in the incoming-message thread instead of spinning in a busy-loop / flooding the log (`DBusException` still logs and continues)
- Notify and clean up pending async callbacks (`CallbackHandler`) on disconnect instead of leaking them
- Added a read-timeout watchdog for the SASL handshake to prevent connections from hanging indefinitely (e.g. Slowloris-style stalls over TCP)
- Fixed `disconnect()` stalling for the whole receiving-service shutdown timeout when called from within a signal handler
- Use constant-time comparison for `DBUS_COOKIE_SHA1` hash verification
- Fixed possible `ArrayIndexOutOfBoundsException` when parsing malformed cookie lines during SASL auth
- Bounded the pending-error queue to avoid unbounded memory growth for unhandled errors
- Clean up sender/receiver executor services when the connection fails to establish
- Reworked and corrected the project documentation under `src/site` (types, quickstart, properties, signals, code generation, new landing page) and documented intentionally unsupported transports (`unixexec`, `launchd`, `autolaunch`)
- Improved and hardened the test suite (event-driven waits instead of fixed sleeps, safer test teardown and additional coverage for the features above)

##### Changes in 5.2.0 (2025-12-21):
- removed properties from dbus-java.version which causes issues with reproducable builds ([PR#279](https://github.com/hypfvieh/dbus-java/issues/279))
Expand Down
20 changes: 20 additions & 0 deletions UPGRADE_TO_6x.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,23 @@ This allows you to use shorter definitions when creating or generating code. Ins

To instruct the InterfaceCodeGenerator to create `Struct` based return values instead of `Tuple`s, use the new `--disable-tuples` option.
Please be aware, that the created code will only work with dbus-java 6.x and will fail during runtime when used with older versions!

#### Behaviour change: automatic `ObjectManager` handling

Starting with dbus-java 6.x, exported objects implementing `org.freedesktop.DBus.ObjectManager` are handled
automatically by default: dbus-java answers `GetManagedObjects` itself (by enumerating the exported sub-tree
and collecting each object's properties) and automatically emits `InterfacesAdded`/`InterfacesRemoved` when
objects below an `ObjectManager` are exported/unexported.

If you already provide your own server-side `ObjectManager` implementation and want to keep full manual
control (your own `GetManagedObjects` and your own signal emission), build the connection with
`withManualObjectManager(true)`:

```java
DBusConnection conn = DBusConnectionBuilder.forSessionBus()
.withManualObjectManager(true)
.build();
```

If you do not implement `ObjectManager` yourself, you can now export a ready-to-use one via
`connection.exportObjectManager("/your/path")` without writing any class.
Loading
Loading