X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:mime-version:to:from:subject:date :content-type:content-transfer-encoding; q=dns; s=default; b=YJy aRp2znppg8QJqzcwt4ySNaetI1oOYdFzTeUoKWieRjgKd0SC5NuQJLUcJlsRxN3d 8TleZkeCudW5S9ClYjpb8ncOJpy4F54R5DMVxqQVJV6DllSTH65gbCmL5XhaZdb7 1RlcQp8xxIQnMPGWb2MM0uqwzd6K3D7DrEeffNn4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:mime-version:to:from:subject:date :content-type:content-transfer-encoding; s=default; bh=uNAhvFicU wuuLaKVJ4NroTnv/s0=; b=FQKVnigHwBLBtc7192rPqhIo8k+hMyKJS6EWPeRKg p/k7unUxGZYoqKQi7I36s97dAFmaIVo3Vs8m2EQ5QIhCTsekkU5D4c0rzqwDqbs9 HHDAhjj4RfprOX6dtPejam9vY9VQNiH6fM+TbrWyI8pdmLXHEz1hCtKcZ1Fy3ad1 sg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=SYSTEM, logging, Ticket, H*MI:1c69fb81 X-HELO: mail-lf1-f43.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:from:subject:date:importance; bh=F5dTGxMO7dzVz/vOvrGU0uR41vvdgY+t3InD/jbiPY8=; b=OdPX48zMmWlgyLrZ1c6OS+QXAGWv1MaFnxeyttGgB58sXMXYyKsWoXkrnStKeGC4NS B+B9H4pxWD9d/D3E5uTSUX+ghimcvsjQ79Adzm1DUP6GCqx4HiZrlCXE97Sy8N0JoDlx jeekMWa2OKiBTq498vrwXzfCjSSjzb4wYXFkpClDk+PKkdMdO3OYXs8y8wsC/d392fQm oM2FHEsexwQvUqIOSvG2L5z/fKf7XxV00QNa/da3fqxHC9elpaLCEAJAqCY+kGH9SOAS QML85FZ3QwIVLoLK00oByirPu5Sim2fTqycTJMU0keUFD978nCV42SSHeaJImYOYqgd4 L65w== Message-ID: <5b92d157.1c69fb81.18fb3.aaac@mx.google.com> MIME-Version: 1.0 To: "cygwin AT cygwin DOT com" From: Marcin Kielar Subject: Fish shell fails with PermissionDenied on rename file, if Cygwin home directory is a Junction. Date: Fri, 7 Sep 2018 21:28:27 +0200 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id w87JSehY006763 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 AT BENEK /c/tmp → fish fish: Unable to rename file from '/home/marcin/.config/fish/fishd.tmp.QvV0Fd' to '/home/marcin/.config/fish/fishd.BENEK.x86_64': Permission denied fish: Unable to rename file from '/home/marcin/.config/fish/fishd.tmp.Os5Tmd' to '/home/marcin/.config/fish/fishd.BENEK.x86_64': Permission denied 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 . 14.04.2018 00:53 .. 11.11.2017 23:45 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