public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction.
@ 2018-09-07 19:28 Marcin Kielar
  2018-09-10 16:06 ` Andrew Schulman
  0 siblings, 1 reply; 5+ messages in thread
From: Marcin Kielar @ 2018-09-07 19:28 UTC (permalink / raw)
  To: cygwin

Hi,

This report originates from a ticket created on Fish Github account here: https://github.com/fish-shell/fish-shell/issues/2590
The issue is, that for some reason, running fish shell fails with PermissionDenied error if the home directory is a Windows Junction.

This is what I get when I run fish in my setup:


marcin@BENEK /c/tmp
→ fish
<E> fish: Unable to rename file from '/home/marcin/.config/fish/fishd.tmp.QvV0Fd' to '/home/marcin/.config/fish/fishd.BENEK.x86_64': Permission denied
<E> fish: Unable to rename file from '/home/marcin/.config/fish/fishd.tmp.Os5Tmd' to '/home/marcin/.config/fish/fishd.BENEK.x86_64': Permission denied
<E> fish: Unable to rename file from '/home/marcin/.config/fish/fishd.tmp.3Bop6u' to '/home/marcin/.config/fish/fishd.BENEK.x86_64': Permission denied


I have my cygwin home directory created as a junction to a folder on another disk, which is managed by OneDrive. This is how this looks from cmd.exe side:


c:\tools\cygwin\home>dir
 Volume in drive C is SYSTEM
 Volume Serial Number is 1AD1-BCDF

 Directory of c:\tools\cygwin\home

14.04.2018  00:53    <DIR>          .
14.04.2018  00:53    <DIR>          ..
11.11.2017  23:45    <JUNCTION>     marcin [d:\OneDrive\tools\CYGWIN_HOME]
               0 File(s)              0 bytes
               3 Dir(s)  77 744 492 544 bytes free



The junction was create with `mklink` command as below:


mklink /J marcin d:\OneDrive\tools\CYGWIN_HOME


What you can see below is an excerpt from the `strace fish > log 2>&1` command.
The bigger trace is available here: http://s000.tinyupload.com/index.php?file_id=09852752977194690660 and contains the whole `strace` log up to the point when it just starts logging identical errors.

The interesting part seems to be this:


   64  381028 [main] fish 2084 mount_info::conv_to_win32_path: conv_to_win32_path (/home/marcin/.config/fish)
   64  381092 [main] fish 2084 mount_info::cygdrive_win32_path: src '/home/marcin/.config/fish', dst ''
   73  381165 [main] fish 2084 set_flags: flags: binary (0x2)
  119  381284 [main] fish 2084 mount_info::conv_to_win32_path: src_path /home/marcin/.config/fish, dst C:\tools\cygwin\home\marcin\.config\fish, flags 0x3000A, rc 0
  248  381532 [main] fish 2084 symlink_info::check: 0x0 = NtCreateFile (\??\C:\tools\cygwin\home\marcin\.config\fish)
  135  381667 [main] fish 2084 symlink_info::check: not a symlink
  100  381767 [main] fish 2084 symlink_info::check: 0 = symlink.check(C:\tools\cygwin\home\marcin\.config\fish, 0xFFFF9150) (0x3000A)
   55  381822 [main] fish 2084 path_conv::check: this->path(C:\tools\cygwin\home\marcin\.config\fish\BENEK), has_acls(1)
  111  381933 [main] fish 2084 __set_errno: int rename2(const char*, const char*, unsigned int):2135 setting errno 2
  147  382080 [main] fish 2084 rename2: -1 = rename(/home/marcin/.config/fish/BENEK, /home/marcin/.config/fish/fishd.BENEK.x86_64), errno 2


We have „not a symlink” response, followed by a failing rename call.

All other Cygwin tools work correctly. I can manually rename the files using `mv`. This does not seem to be ACL / access issue, or at least not for any other tools I use, and I use Cygwin in this setup for years. Earlier, the junction was to a Dropbox-managed folder, now it’s OneDrive-managed one. This however seems not to make any difference, and it seems that the Junction is the main issue.

Please also have a look at the Github Ticket, perhaps you’ll find more details in there.

I’ll be happy to provide more information/logs/etc if required.

-- 
Regards,
Marcin Kielar


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction.
  2018-09-07 19:28 Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction Marcin Kielar
@ 2018-09-10 16:06 ` Andrew Schulman
  2018-09-11 12:46   ` cyg Simple
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Schulman @ 2018-09-10 16:06 UTC (permalink / raw)
  To: cygwin

> This report originates from a ticket created on Fish Github account here: https://github.com/fish-shell/fish-shell/issues/2590
> The issue is, that for some reason, running fish shell fails with PermissionDenied error if the home directory is a Windows Junction.

Unfortunately I don't know how to help with this. fish works fine except in
this case where the directory ~/.config/fish is somewhere under a Windows
junction. Since I don't know how to solve that, I asked Marcin to report
the problem here.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction.
  2018-09-10 16:06 ` Andrew Schulman
@ 2018-09-11 12:46   ` cyg Simple
  2018-09-11 15:50     ` Andrew Schulman
  0 siblings, 1 reply; 5+ messages in thread
From: cyg Simple @ 2018-09-11 12:46 UTC (permalink / raw)
  To: cygwin

On 9/10/2018 12:06 PM, Andrew Schulman wrote:
>> This report originates from a ticket created on Fish Github account here: https://github.com/fish-shell/fish-shell/issues/2590
>> The issue is, that for some reason, running fish shell fails with PermissionDenied error if the home directory is a Windows Junction.
> 
> Unfortunately I don't know how to help with this. fish works fine except in
> this case where the directory ~/.config/fish is somewhere under a Windows
> junction. Since I don't know how to solve that, I asked Marcin to report
> the problem here.
> 

A windows `junction` and not a `symlink`?  They're not the same thing.
If you truly mean `junction` then the issue is yours to fix.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction.
  2018-09-11 12:46   ` cyg Simple
@ 2018-09-11 15:50     ` Andrew Schulman
  2018-09-11 19:28       ` cyg Simple
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Schulman @ 2018-09-11 15:50 UTC (permalink / raw)
  To: cygwin

> On 9/10/2018 12:06 PM, Andrew Schulman wrote:
> >> This report originates from a ticket created on Fish Github account here: https://github.com/fish-shell/fish-shell/issues/2590
> >> The issue is, that for some reason, running fish shell fails with PermissionDenied error if the home directory is a Windows Junction.
> > 
> > Unfortunately I don't know how to help with this. fish works fine except in
> > this case where the directory ~/.config/fish is somewhere under a Windows
> > junction. Since I don't know how to solve that, I asked Marcin to report
> > the problem here.
> > 
> 
> A windows `junction` and not a `symlink`?  They're not the same thing.

Note that I'm not the one who has this problem, but my understanding is
that it happens when the ~/.config/fish is somewhere under a Windows
junction, not a symlink.

> If you truly mean `junction` then the issue is yours to fix.

It's true that the user could avoid the problem by changing their file
systems so that ~/.config/fish isn't under a junction point. But I don't
think they should have to do that.

To me it seems like a bug that rename2() is failing when the target file is
under a junction point.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction.
  2018-09-11 15:50     ` Andrew Schulman
@ 2018-09-11 19:28       ` cyg Simple
  0 siblings, 0 replies; 5+ messages in thread
From: cyg Simple @ 2018-09-11 19:28 UTC (permalink / raw)
  To: cygwin

On 9/11/2018 11:50 AM, Andrew Schulman wrote:
>> On 9/10/2018 12:06 PM, Andrew Schulman wrote:
>>>> This report originates from a ticket created on Fish Github account here: https://github.com/fish-shell/fish-shell/issues/2590
>>>> The issue is, that for some reason, running fish shell fails with PermissionDenied error if the home directory is a Windows Junction.
>>>
>>> Unfortunately I don't know how to help with this. fish works fine except in
>>> this case where the directory ~/.config/fish is somewhere under a Windows
>>> junction. Since I don't know how to solve that, I asked Marcin to report
>>> the problem here.
>>>
>>
>> A windows `junction` and not a `symlink`?  They're not the same thing.
> 
> Note that I'm not the one who has this problem, but my understanding is
> that it happens when the ~/.config/fish is somewhere under a Windows
> junction, not a symlink.
> 
>> If you truly mean `junction` then the issue is yours to fix.
> 
> It's true that the user could avoid the problem by changing their file
> systems so that ~/.config/fish isn't under a junction point. But I don't
> think they should have to do that.
> 
> To me it seems like a bug that rename2() is failing when the target file is
> under a junction point.
> 

See https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks to
determine if you can find a solution.  In general though junctions are
treated as symlinks while traveling into the directory.  However the
file system attributes are specific and required as described in the
document I pointed to above.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-11 19:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 19:28 Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction Marcin Kielar
2018-09-10 16:06 ` Andrew Schulman
2018-09-11 12:46   ` cyg Simple
2018-09-11 15:50     ` Andrew Schulman
2018-09-11 19:28       ` cyg Simple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).