Sunan Abi Dawud Book 2, Hadith 310
I narrate what I witnesses from Abu Sa'id and heard from him. Abu Sa'id entered upon Marwan and said: I heard the Messenger of Allah (ﷺ) say: When one of you prays facing any object which conceals him from people, and someone wishes to pass in front of him, he should strike him at his chest; if he refuses (to go), he should fight him; he is only a devil.
Abu Dawud said: Sufyan Ath-Thawri said: "A person arrogantly walks in front of me while I am praying, so I stop him, and a weak person passes, so I dont stop him."
I saw 'Ata b. Yazid al-Laithi praying in a standing posture. So I went to him passing in front of him; he, therefore, turned me away. He then said to me: Abu Sa'id al-Khudri reported the Messenger of Allah (ﷺ) as saying: If anyone of you can do that he should not let anyone pass between him and the qiblah, he should do it.
The Messenger of Allah(ﷺ) as saying: "If one who passes in front of a man who is praying knew the responsibility he incurs, he would prefer to stand still for forty. . . rather than pass in front of him. Abu al-Nadr said: I do not know whether he said forty days, or months, or years."
Abu Dawud: Sufyan al-Thawri said: If a man passes proudly in front of me while I am praying, I shall stop him, and if a weak man passes, I shall not stop him.