diff --git a/src/config.rs b/src/config.rs index 946d035..20c96ed 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,11 +21,16 @@ const EXPECTED_DOCTYPE_PARTS: &[&str] = &[ /// implements [`dbus-daemon`'s Configuration File](https://dbus.freedesktop.org/doc/dbus-daemon.1.html#configuration_file) #[derive(Clone, Debug, Default, Deserialize, DeserializeQuery, PartialEq)] pub struct BusConfig { - /// If true, the bus daemon becomes a real daemon (forks into the background, etc.). + /// If `Some`, connections that authenticated using the ANONYMOUS mechanism will be authorized to connect. + /// This option has no practical effect unless the ANONYMOUS mechanism has also been enabled using the `auth` option. + #[query(".allow_anonymous")] + // TODO: consider finding a way to make this `bool` instead of `Option<()>` + pub allow_anonymous: Option<()>, + /// If `Some`, the bus daemon becomes a real daemon (forks into the background, etc.). #[query(".fork")] // TODO: consider finding a way to make this `bool` instead of `Option<()>` pub fork: Option<()>, - /// If true, the bus daemon keeps its original umask when forking. + /// If `Some`, the bus daemon keeps its original umask when forking. /// This may be useful to avoid affecting the behavior of child processes. #[query(".keep_umask")] // TODO: consider finding a way to make this `bool` instead of `Option<()>` @@ -33,6 +38,7 @@ pub struct BusConfig { /// The bus daemon will write its pid to the specified file. #[query(".pidfile")] pub pidfile: Option, + /// If `Some`, the bus daemon will log to syslog. #[query(".syslog")] // TODO: consider finding a way to make this `bool` instead of `Option<()>` pub syslog: Option<()>, @@ -156,10 +162,11 @@ mod tests { } #[test] - fn bus_config_parse_with_fork_and_keep_umask_and_syslog_ok() { + fn bus_config_parse_with_allow_anonymous_and_fork_and_keep_umask_and_syslog_ok() { let input = r#" + @@ -171,6 +178,7 @@ mod tests { assert_eq!( busconfig, BusConfig { + allow_anonymous: Some(()), fork: Some(()), keep_umask: Some(()), syslog: Some(()),