; and (B) require the alien to seek permanent residence by applying for an immigrant visa at a United States embassy or consulate in the alien’s home country or other foreign country, as designated by the Secretary of State, if the Secretary of Homeland Security determines that the alien may be a threat to national security or public safety or if the Secretary of Homeland Security determines that a favorable exercise of discretion to allow such adjustment of status in the United States is not warranted. . (b) Prohibition on terrorists and aliens who pose a threat to national security or public safety on adjustment to lawful permanent resident status Subsection (c) of section 245 of the Immigration and Nationality Act ( 8 U.S.C. 1255(c) ) is amended to read as follows: (c) Aliens not eligible for adjustment of status Other than an alien having an approved petition for classification as a VAWA self-petitioner, subsection (a) shall not be applicable to— (1) an alien crewman; (2) subject to subsection (k), an alien (other than an immediate relative as defined in section 201(b) or a special immigrant described in subparagraph (H), (I), (J), or (K) of section 101(a)(27)) who hereafter continues in or accepts unauthorized employment prior to filing an application for adjustment of status or who is in unlawful immigration status on the date of filing the application for adjustment of status or who has failed (other than through no fault of his or her own or for technical reasons) to maintain continuously a lawful status since entry into the United States; (3) any alien admitted in transit without visa under section 212(d)(4)(C); (4) an alien (other than an immediate relative as defined in section 201(b)) who was admitted as a nonimmigrant visitor without a visa under section 212(l) or section 217; (5) an alien who was admitted as a nonimmigrant described in section 101(a)(15)(S); (6) an alien who described in section 237(a)(4)(B), (F), or (G)