Skip to content

Commit

Permalink
smbj: throw IOException instead of SMB2GuestSigningRequiredException …
Browse files Browse the repository at this point in the history
…to not crash

See nova-video-player/aos-AVP#1324
  • Loading branch information
courville committed Dec 7, 2024
1 parent 719af25 commit 2cf5733
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/archos/filecorelibrary/smbj/SmbjUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.hierynomus.smbj.auth.AuthenticationContext;
import com.hierynomus.smbj.common.SMBRuntimeException;
import com.hierynomus.smbj.connection.Connection;
import com.hierynomus.smbj.session.SMB2GuestSigningRequiredException;
import com.hierynomus.smbj.session.Session;
import com.hierynomus.smbj.share.DiskShare;

Expand Down Expand Up @@ -103,7 +104,12 @@ public synchronized void getSmbConnection(Uri uri) throws IOException, SMBApiExc
smbjConnections.put(cred, smbConnection);
// need to regenerate smbSession in this case too
AuthenticationContext ac = new AuthenticationContext(username, password.toCharArray(), domain);
Session smbSession = smbConnection.authenticate(ac);
try {
Session smbSession = smbConnection.authenticate(ac);
} catch (SMB2GuestSigningRequiredException e) {
log.error("getSmbConnection: caught SMB2GuestSigningRequiredException " + e.getMessage() + " for uri " + uri + " -> throwing IOException instead");
throw new IOException("getSmbConnection: SMB2GuestSigningRequiredException");
}
smbjSessions.put(cred, smbSession);
}
}
Expand Down

0 comments on commit 2cf5733

Please sign in to comment.