In the case of the Military the weapons are locked in a secure location and remain on the aircraft during night stops.
If they, the locals have some sort of amory or police station then they are checked and reclaimed prior to departure.
Many times I have walked through civilian airports and only had to show my military concealed weapons permit.
Never a problem.
Sure the airlines have all of this worked out.
International flights, embassy runs etc.