Restrict the files to be processed from /etc/profile.d to those following a sensible regular expression.