Skip to content

Commit

Permalink
🥅 zb: Gracefully handle rejection of UNIX FD passing
Browse files Browse the repository at this point in the history
  • Loading branch information
zeenix committed May 8, 2024
1 parent 51d918c commit d2df7e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zbus/src/connection/handshake/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use async_trait::async_trait;
use std::collections::VecDeque;
use tracing::{debug, instrument, trace};
use tracing::{debug, instrument, trace, warn};

use sha1::{Digest, Sha1};

Expand Down Expand Up @@ -205,12 +205,12 @@ impl Client {
self.set_guid(guid)?;
}
Command::AgreeUnixFD => self.common.set_cap_unix_fd(true),
// This also covers "REJECTED" and "ERROR", which would mean that the server has
// rejected the authentication challenge response (likely cookie) since it
// already agreed to the mechanism. Theoretically we should
// be just trying the next auth mechanism but this most
// likely means something is very wrong and we're already
// too deep into the handshake to recover.
Command::Error(e) => warn!("UNIX file descriptor passing rejected: {e}"),
// This also covers "REJECTED", which would mean that the server has rejected the
// authentication challenge response (likely cookie) since it already agreed to the
// mechanism. Theoretically we should be just trying the next auth mechanism but
// this most likely means something is very wrong and we're already too deep into
// the handshake to recover.
cmd => {
return Err(Error::Handshake(format!(
"Unexpected command from server: {cmd}"
Expand Down

0 comments on commit d2df7e2

Please sign in to comment.