Sunan Ibn Majah
Sunan Ibn Majah 768
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ، ح وَحَدَّثَنَا أَبُو بِشْرٍ، بَكْرُ بْنُ خَلَفٍ حَدَّثَنَا يَزِيدُ بْنُ زُرَيْعٍ، قَالاَ حَدَّثَنَا هِشَامُ بْنُ حَسَّانَ، عَنْ مُحَمَّدِ بْنِ سِيرِينَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " إِنْ لَمْ تَجِدُوا إِلاَّ مَرَابِضَ الْغَنَمِ وَأَعْطَانَ الإِبِلِ فَصَلُّوا فِي مَرَابِضِ الْغَنَمِ وَلاَ تُصَلُّوا فِي أَعْطَانِ الإِبِلِ " .
Unreviewed translation. All hadiths in this collection are available in five languages. Titles and introductions may remain in Arabic.
Abu Bakr ibn Abi Shaybah narrated to us: Yazid ibn Harun narrated to us. (A second route:) Abu Bishr Bakr ibn Khalaf narrated to us: Yazid ibn Zuray' narrated to us. Both said: Hisham ibn Hassan narrated to us, from Muhammad ibn Sirin, from Abu Hurayrah, who said: The Messenger of Allah (peace and blessings be upon him) said: ‘If you can find no place except sheep pens and camel resting places, then pray in the sheep pens and do not pray in the camel resting places.’
Notes and open questions — unreviewed
The source gives a condition (‘if you can find no place except’) and explicitly permits sheep pens while prohibiting camel resting places.