Recall that Obama’s mother worked at the US Embassy in Indonesia. her employers would have had full knowledge of Obama and his status. Maybe Obama obtained some kind of Ambassadorial waiver for being the child of an American Embassy employee.
No wavier needed. And an Ambassador has no power to issue any kind of wavier in that regards. The rule of law prevails.