My take is that, no, a charmed creature cannot attack the charmer. A charmed creature who has been attacked, asked to kill himself or won an opposed charisma check on a "absolutely would not do" command can, but then the charm has ended.
People have come up with a lot of hypotheticals where a character would normally choose their principals over their friends and cease their friendly attitude towards someone they usually have one towards - but as mentioned above, deciding to stop being friendly isn't really an option in the context of the spell.
As with the suggestion spell, it is entirely possible that after the spell effect is over, the character will say "What on [insert planet/plane here] was I THINKING??????" and regret their actions. If they had lost some charisma checks and done things they normally Just Wouldn't Do, I personally might even automaticly give them the +5 'being attacked' bonus if the same caster ever tried it again.