40.—(1) Every person who, when in a ship, disobeys any lawful command given by the captain of the ship in relation to the navigation or handling of the ship or affecting the safety of the ship, shall be guilty of an offence and shall be liable on conviction by a subordinate military court to imprisonment for life or any less punishment authorised by this Act.
(2) For the purposes of this section, every person of whatever rank is, when he or she is in a ship, under the command, as respects all matters relating to the navigation or handling of the ship or affecting the safety of the ship, of the captain of the ship.