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

Jeremy Allison jra at samba.org
Thu Feb 9 17:59:44 UTC 2017


On Thu, Feb 09, 2017 at 02:55:22PM +0000, Youzhong Yang wrote:
> 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.

Please log a bug so I can track this. Thanks !



More information about the samba-technical mailing list