I am sure someone else has said this, but the fact that the Immigration/Muslim Ban Executive Order no longer includes Iraq suggests that SecDef Mattis might have had some influence on Trump. How so?
The Iraqis were mighty miffed after the first EO, and threatened to kick out American contractors and perhaps other civilians in response. These folks are critical for supporting the US troops in the counter-ISIS campaign, and are one of the key military equities that Trump blithely ignored when excluding Mattis from the making of the previous EO.
So, we can glean from the new EO perhaps some Mattis influence. Before we get our hopes up that there are now adults in the room, we need to remember that the EO still harms American interests--antagonizing our allies, giving ISIS a propaganda tool, hurting green card veterans (those who have fought and perhaps are still fighting for the US but come from the wrong countries), etc. DHS and others have indicated that the US has not been hit by terrorists from these six or seven countries. No, those would be either white supremacists or extremists from countries where, coincidentally, Trump has major investments (Egypt, Saudi Arabia).
Oh, and let's not have too much faith in our retired generals. John Kelly, head of DHS, has not been any kind of moderating force on those underneath him at ICE or CBP.
Still, I guess in this darkest timeline we have to look for glimmers of hope, and Mattis potentially squelching a piece of this is a tiny glimmer, I suppose.