Abu Huraira reported God’s Messenger as saying, “A woman, an ass and a dog cut off the prayer, but something like the back of a saddle guards against that.”
Abu Sa'id reported God’s Messenger as saying, “When one of you prays facing something which conceals him from people and someone wishes to pass in front of him, he should turn away; but if he refuses to go, he should turn him away forcibly, for he is only a devil.”
This is Bukhari’s wording, and Muslim has something to the same effect.
Abu Juhaim reported God’s Messenger as saying, ‘‘If one who passes in front of a man who is praying knew the responsibility he incurs, to stand still for forty would be better for him than to pass in front of him.” Abun Nadr said, “I do not know whether he said forty days, or months, or years.”