On Tue, Jan 3, 2017 at 12:58 AM, Joachim Durchholz <j...@durchholz.org> wrote: > > indir solves all these things. (Provided it changes the current directory > back even in the face of exceptions.)
Edge case: current directory can't be re-entered by path (as with the old MMDF trick: daemon launcher running as root chdir()s to a directory via a path where one component is only searchable by root, then drops perms and runs the real daemon. Another way to do it is rename() or rmdir() one path component). This can be worked around if the platform supports fchdir(), otherwise you just can't get back where you were. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net