apply tmp dir patch