Despite a White House veto threat, the Senate has approved a controversial defense appropriations bill.