The US attacked Afghanistan, generally with world wide approval (including close allies/neighbors) because those who attacked America planned the attack under the were under the protection of the Afghan government.
If (and when) al-qaeda attacks US again, it is going to be the government of Pakistan that will be harboring the terrorists and who will be on the receiving end of America's rage. It doesn't matter who is president.
That is a bit far fetched. Unless Pakistan falls to a highly religious mullah harboring terrorist, I dont think US would declare an all out war against Pakistan. They may hit pockets of terrorist inside Pakistan most probably with Pakistan military support.