smbd enters infinite loop when trying to open an invalid symlink with O_CREAT

Youzhong Yang Youzhong.Yang at mathworks.com
Thu Feb 9 14:55:22 UTC 2017


Reproduction is simple:


-          On the server, create a symbolic link pointing to a nonexistent file

-          Use the following program on Windows to open the symlink:

#include <stdio.h>
#include <tchar.h>
#include <windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
       HANDLE h;

       h = CreateFile(argv[1],
              GENERIC_READ | GENERIC_WRITE,
              FILE_SHARE_READ|FILE_SHARE_WRITE,
              NULL, CREATE_ALWAYS, 0, NULL);
       printf("hit <cr>\n");
       getchar();
       CloseHandle(h);

       return 0;
}

I believe fd_open_atomic() needs to handle the symlink case specifically. Please advise.

Thanks,

--Youzhong



More information about the samba-technical mailing list