It was narrated from 'Ubadah bin As-Samit that the Messenger of Allah said:
Why don't you pledge to me upon that which the women have pledged: That you will not associate anything with Allah, that you will not steal, that you will not have unlawful sexual relations, that you will not utter slander, fabricating from between your hands and feet, and that you will not disobey me in goodness (Ma'ruf)? We said: yes, O Messenger of Allah. So we gave him our pledge, on that basis. The Messenger of Allah said: Whoever commits any of these actions after that, and is punished, that will be an expiation. Whoever is not punished, then his affair is up to Allah; if He wills, He will forgive him, and if He wills, He will punish him.