fixes #17382 alternate to #22979 deal with cases in which group/host have . in name updated as per feedbck only be strict about extension when doing dirs also avoid ~ endings