1
0
Fork 0
forked from wry/wry

config: allow running commands privileged

This commit is contained in:
Julian Orth 2024-04-01 13:16:34 +02:00
parent 4558bdb7c1
commit affea49e49
11 changed files with 74 additions and 5 deletions

View file

@ -804,6 +804,19 @@ impl ConfigProxyHandler {
self.state.explicit_sync_enabled.set(enabled);
}
fn handle_get_socket_path(&self) {
match self.state.acceptor.get() {
Some(a) => {
self.respond(Response::GetSocketPath {
path: a.socket_name().to_string(),
});
}
_ => {
log::warn!("There is no acceptor");
}
}
}
fn handle_connector_connected(&self, connector: Connector) -> Result<(), CphError> {
let connector = self.get_connector(connector)?;
self.respond(Response::ConnectorConnected {
@ -1732,6 +1745,7 @@ impl ConfigProxyHandler {
ClientMessage::SetExplicitSyncEnabled { enabled } => {
self.handle_set_explicit_sync_enabled(enabled)
}
ClientMessage::GetSocketPath => self.handle_get_socket_path(),
}
Ok(())
}