{"action":"created","issue":{"url":"https://api.github.com/repos/Alexpux/Cygwin/issues/13","labels_url":"https://api.github.com/repos/Alexpux/Cygwin/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/Alexpux/Cygwin/issues/13/comments","events_url":"https://api.github.com/repos/Alexpux/Cygwin/issues/13/events","html_url":"https://github.com/Alexpux/Cygwin/issues/13","id":117152397,"number":13,"title":"MSYS=winsymlinks:nativestrict breaks core symlinks (/dev/fd, etc)","user":{"login":"jliben","id":4372685,"avatar_url":"https://avatars.githubusercontent.com/u/4372685?v=3","gravatar_id":"","url":"https://api.github.com/users/jliben","html_url":"https://github.com/jliben","followers_url":"https://api.github.com/users/jliben/followers","following_url":"https://api.github.com/users/jliben/following{/other_user}","gists_url":"https://api.github.com/users/jliben/gists{/gist_id}","starred_url":"https://api.github.com/users/jliben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jliben/subscriptions","organizations_url":"https://api.github.com/users/jliben/orgs","repos_url":"https://api.github.com/users/jliben/repos","events_url":"https://api.github.com/users/jliben/events{/privacy}","received_events_url":"https://api.github.com/users/jliben/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-16T15:43:25Z","updated_at":"2015-11-16T22:03:16Z","closed_at":null,"body":"Hi there, \r\n\r\nI'm using msys2 to allow to run shell scripts on windows, which start a java application. This app is creating multiple symlinks to JAVA installation directory, so I decided to enable option MSYS=winsymlinks:nativestrict (which would otherwise result in copying the JDK)\r\n\r\nI disovered the issue I'm reporting here when I accidentally deleted /dev/fd and /dev/std{in,out,err}. Those files are recreated by the /etc/profile postinstall scripts.\r\n\r\nIf you ls -l on a regular msys2/cygwin install, you'll see that they are symlinks to another symlink (/proc/self/...)\r\n\r\n```\r\n$ ls -l /dev/{fd,std*}\r\nlrwxrwxrwx 1 jliben Domain Users 13 16 nov.  16:37 /dev/fd -> /proc/self/fd\r\nlrwxrwxrwx 1 jliben Domain Users 15 16 nov.  16:37 /dev/stderr -> /proc/self/fd/2\r\nlrwxrwxrwx 1 jliben Domain Users 15 16 nov.  16:37 /dev/stdin -> /proc/self/fd/0\r\nlrwxrwxrwx 1 jliben Domain Users 15 16 nov.  16:37 /dev/stdout -> /proc/self/fd/1\r\n```\r\n\r\nBut if you erase those files, modify the msys2_shell.bat file to:\r\n```\r\nset MSYS=winsymlinks:nativestrict\r\n```\r\n\r\n... you'll get the following output:\r\n```\r\n$ ls -l /dev/{fd,std*}\r\nlrwxrwxrwx 1 jliben Domain Users 14 16 nov.  16:20 /dev/fd -> /proc/10264/fd\r\nlrwxrwxrwx 1 jliben Domain Users 16 16 nov.  16:20 /dev/stderr -> /proc/13540/fd/2\r\nlrwxrwxrwx 1 jliben Domain Users 16 16 nov.  16:20 /dev/stdin -> /proc/13504/fd/0\r\nlrwxrwxrwx 1 jliben Domain Users 16 16 nov.  16:20 /dev/stdout -> /proc/14092/fd/1\r\n```\r\n\r\nwhich makes some things disfunctional, because the symlinks have been created to the actual files at the time of running the shell the first time.\r\n\r\nI am not really familiar with the way the different symlinks are being handled, so I'm unable to propose a patch (I actually don't understand where in the cygwin codebase this is handled) but I gather that those files should actually be kept as \"regular cygwin symlinks\", i.e files with the magic cookie and the path to the target stored inside.\r\n\r\nDo you think there is something that could be done to keep on handling those special files as cygwin  symlinks ? "},"comment":{"url":"https://api.github.com/repos/Alexpux/Cygwin/issues/comments/157185478","html_url":"https://github.com/Alexpux/Cygwin/issues/13#issuecomment-157185478","issue_url":"https://api.github.com/repos/Alexpux/Cygwin/issues/13","id":157185478,"user":{"login":"mingwandroid","id":1042804,"avatar_url":"https://avatars.githubusercontent.com/u/1042804?v=3","gravatar_id":"","url":"https://api.github.com/users/mingwandroid","html_url":"https://github.com/mingwandroid","followers_url":"https://api.github.com/users/mingwandroid/followers","following_url":"https://api.github.com/users/mingwandroid/following{/other_user}","gists_url":"https://api.github.com/users/mingwandroid/gists{/gist_id}","starred_url":"https://api.github.com/users/mingwandroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mingwandroid/subscriptions","organizations_url":"https://api.github.com/users/mingwandroid/orgs","repos_url":"https://api.github.com/users/mingwandroid/repos","events_url":"https://api.github.com/users/mingwandroid/events{/privacy}","received_events_url":"https://api.github.com/users/mingwandroid/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T22:03:16Z","updated_at":"2015-11-16T22:03:16Z","body":"sounds reasonable @elieux "}}