Ketubot 27 - A siege
If a city was besieged and captured by an army, all woman living there who are wives of Kohanim are presumed to be violated and must leave their husbands. However, if there is a hiding place in the city, then each woman can be presumed to have been hiding there, and thus all women are permitted to remain with their husbands. Also, if she has any one witness, this suffices.
This rule does not seem to agree with another rule about soldiers: if a marauding troop came to a city, then in the time of peace open barrels are prohibited, but closed ones are still permitted - since it is presumed that the soldiers drank from the open ones and made libations. However, at the time of war all barrels are permitted - because the soldiers do not have time to turn away to wine. We see then that the soldiers are busy with war! - True, they won't have the time for wine, but they will have the time for women.
All of the above is true for the enemy army, but a friendly army will not antagonize the citizens. What about a single marauder of even a friendly army, who may separate from the group and enter a city? - We are talking about a situation where the groups of soldiers see each other, so he can't sneak in unnoticed. And yet, they guards may doze off? - We are talking about a case where the city is surrounded with chains, dogs, spikes and geese, to stop and scare off marauders. Others, however, do not require all these precautions against marauders.
Art: Marauders Attacking Villagers on the Edge of a Wood by Sebastien Vrancx