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.”
Talha b. ‘Ubaidallah reported God’s Messenger as saying, “When one of you places in front of him something such as the back of a saddle, he should pray without caring who passes on the other side of it.”
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.
Nafi’ said on the authority of Ibn ‘Umar that the Prophet used to make his riding-beast kneel between him and the qibla and pray facing it.
(Bukhari and Muslim.) Bukhari added that Nafi' asked Ibn ‘Umar, saying, “Tell me what happened when the camels moved away,” to which he replied, “He used to take the saddle, put it straight, and pray facing the back of it.”