According to another Tradition emanating from Abu Humaidah and quoted in Musnad Ahmad, the Holy Prophet said that there was no harm in such a procedure.
قَالُوا وَمَا حَقُّ الطَّرِيقِ يَا رَسُولَ اللهِ قَالَ غَضُّ الْبَصَرِ وَكَفُّ الْأَذَى وَرَدُّ السَّلَامِ وَالْأَمْرُ بِالْمَعْرُوفِ وَالنَّهْيُ عَنْ الْمُنْكَرِ.