On 15.10.2017 21:50, Greg Kurz wrote: >> Hi again, >> >> I see one thing: symlinks somewhere in the path (which seemed to be the >> reason introducing the *at family). But I think that this can be handled >> by canonlizing the path, too. realpath should do the job quite well. >> > > Unfortunately now because we have TOCTOU condition here: some path element > could be replaced by a symlink after realpath() but before we actually pass > the resulting path to a syscall.
Ah, yes, you are right. So lets go on the "hard way" (ntdll) again. This approach seems to work in general, but somehow I get stack corrumption or something like that after returning from a function which makes the relativ NTOpenFile call. But should be fixable. Then the big work piece is to emulate posix behavior with NT* functions *g* Michael Fritscher