public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Marcin Kielar <marcin.kielar@gmail.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction.
Date: Fri, 07 Sep 2018 19:28:00 -0000	[thread overview]
Message-ID: <5b92d157.1c69fb81.18fb3.aaac@mx.google.com> (raw)

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

             reply	other threads:[~2018-09-07 19:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 19:28 Marcin Kielar [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b92d157.1c69fb81.18fb3.aaac@mx.google.com \
    --to=marcin.kielar@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).