"When you come to a shepherd, call him three times. If he answers (all well and good), otherwise drink (milk from the flock) without taking advantage. And when you come to a garden call the owner of the garden three times. If he answers (all well and good), otherwise eat (from the produce of the garden) without taking advantage." (Using translation from Ibn Mājah 2300)
عَنِ النَّبِيِّ ﷺ قَالَ «إِذَا أَتَيْتَ عَلَى رَاعٍ فَنَادِهِ ثَلَاثَ مَرَّاتٍ فَإِنْ أَجَابَكَ وَإِلَّا فَاشْرَبْ مِنْ غَيْرِ أَنْ تُفْسِدَ وَإِذَا أَتَيْتَ عَلَى حَائِطِ بُسْتَانٍ فَنَادِ صَاحِبَ الْبُسْتَانِ ثَلَاثَ مَرَّاتٍ فَإِنْ أَجَابَكَ وَإِلَّا فَكُلْ مِنْ غَيْرِ أَنْ تُفْسِدَ»