Sayyiduna Abu Mas'ud (may Allah be pleased with him) said: On the day of Hajj I was in front of the Messenger of Allah (peace and blessings be upon him), and the foam of his (peace and blessings be upon him) she-camel was falling on my back, and I heard him (peace and blessings be upon him) saying: "Give every person who has a right his due. The child belongs to the one on whose bed it was born, and for the fornicator is the stone (that is, deprivation). Whoever attributes his clientship (wala') to other than those who freed him, or attributes his lineage to other than his father, upon him is the curse of Allah, the angels and all of mankind; neither any obligatory act nor any voluntary act will be accepted from him."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14791