1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Smack 4.2.1

-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlmR75tfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFLeXggAjdgj7YVUe22NtamnROBj1c3PaWwgSY0gEjcyDPsOz5qeqNUdQLHbmt2j
 XQQpYZWKg1/1uoQHlsixaFKbGVctKRk72aNEodRfd1osta11WTOwZKEb8nI411Tt
 7M0Fhf430WZY6nioZiZIorsmid57fftJ2EMPlmjEDp2FD0AVGAXkEhCneGaPtt9Q
 hbWbepIy9tApeIH+QgmFLBmPLnFCaSg+X6NUden3Z21bUz5vH8pmcbeUVfsNB7kW
 nkkDuNwKHPFLgjuhcq7D+KAKRwNU7n8WEuHseRzM7bMCEB+S/rZok5KPXe/tV4v+
 YZKN2e+2yh4j5l4FT/fCzELfWcvrgA==
 =MV3G
 -----END PGP SIGNATURE-----

Merge tag '4.2.1'

Smack 4.2.1
This commit is contained in:
Florian Schmaus 2017-08-14 20:59:32 +02:00
commit 43abd52d76
26 changed files with 332 additions and 228 deletions

View file

@ -1676,8 +1676,8 @@ public final class Roster extends Manager {
final XMPPConnection connection = connection();
RosterPacket rosterPacket = (RosterPacket) iqRequest;
EntityFullJid localAddress = connection.getUser();
if (localAddress == null) {
EntityFullJid ourFullJid = connection.getUser();
if (ourFullJid == null) {
LOGGER.warning("Ignoring roster push " + iqRequest + " while " + connection
+ " has no bound resource. This may be a server bug.");
return null;
@ -1685,12 +1685,23 @@ public final class Roster extends Manager {
// Roster push (RFC 6121, 2.1.6)
// A roster push with a non-empty from not matching our address MUST be ignored
EntityBareJid jid = localAddress.asEntityBareJid();
EntityBareJid ourBareJid = ourFullJid.asEntityBareJid();
Jid from = rosterPacket.getFrom();
if (from != null && !from.equals(jid)) {
LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid='" + jid + "' from='" + from
+ "'");
return IQ.createErrorResponse(iqRequest, Condition.service_unavailable);
if (from != null) {
if (from.equals(ourFullJid)) {
// Since RFC 6121 roster pushes are no longer allowed to
// origin from the full JID as it was the case with RFC
// 3921. Log a warning an continue processing the push.
// See also SMACK-773.
LOGGER.warning(
"Received roster push from full JID. This behavior is since RFC 6121 not longer standard compliant. "
+ "Please ask your server vendor to fix this and comply to RFC 6121 § 2.1.6. IQ roster push stanza: "
+ iqRequest);
} else if (!from.equals(ourBareJid)) {
LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid='" + ourBareJid + "' from='"
+ from + "'");
return IQ.createErrorResponse(iqRequest, Condition.service_unavailable);
}
}
// A roster push must contain exactly one entry