From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123015 invoked by alias); 29 Apr 2016 00:06:02 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 122991 invoked by uid 89); 29 Apr 2016 00:06:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Pavlovsky, pavlovsky, pavlovsky!, Pavlovsky! X-HELO: mail-ig0-f196.google.com Received: from mail-ig0-f196.google.com (HELO mail-ig0-f196.google.com) (209.85.213.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 29 Apr 2016 00:05:51 +0000 Received: by mail-ig0-f196.google.com with SMTP id c3so745690igl.3 for ; Thu, 28 Apr 2016 17:05:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=Cy+yHo80moY7EPUMzX4OaJmc7jmkQSQju09TnGC5DfY=; b=ACkuDD5ld05W8cvtk+1pgTJbU6ETz4+23u1FzWTuKyGaNC+NTjw7cmUIhXpFYaYchv VcfpWhulaIEa1iwGr2wBuf09SaF3ppikDr3PrcfgTWPsSCxwM7LhaSkbLFrGPVo+GN3D ivqWwM9O82/Fivada2h2C9xM8wv7+U5PiaWo7HQBUQZ6qWjUaDzQ1cDeSyl7YSmm6xmC ymSADTmpWP5hOhMxPaQ2TQAqZAHg2VQxUVbwZDXyXJvssDMCnzVB0lfFbtSzgAWnfnh7 0R4ouDzC/QKH6Pq9aD3gf1aBy6xd70JtzAhIk+zaZPHAe+ZCArL3C4GSZL6op57Mrg76 bkBw== X-Gm-Message-State: AOPr4FVdWeBfYDNg9rAmJB/A1HHKpVyBolSvsK7pLROffk16bMr63/fvqc/93WyVdTvpJxrVz5oFewZM32BkQg== MIME-Version: 1.0 X-Received: by 10.50.29.39 with SMTP id g7mr806199igh.50.1461888349765; Thu, 28 Apr 2016 17:05:49 -0700 (PDT) Received: by 10.79.22.134 with HTTP; Thu, 28 Apr 2016 17:05:49 -0700 (PDT) In-Reply-To: <1606116423.20160429020650@yandex.ru> References: <1606116423.20160429020650@yandex.ru> Date: Fri, 29 Apr 2016 00:09:00 -0000 Message-ID: Subject: Re: `CYGWIN=winsymlinks:nativestrict`, `ln -s target link` fails if target doesn't exist From: Gene Pavlovsky To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-04/txt/msg00634.txt.bz2 I don't know if POSIX standard has something to say about that, but here's a reference from GNU libc: `man 2 symlink`: > A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent one; the latter case is known as a dangling link. On 29 April 2016 at 02:06, Andrey Repin wrote: > Greetings, Gene Pavlovsky! > >> I have an issue to report: > >> Introduction: On a UNIX system, `ln -s target link` creates a link >> regardless of target's existence. >> This is used in some scripts, e.g. Gentoo's `run-crons` (which I also >> use on Cygwin) uses a symlink pointing to the running process PID as >> lockfile. >> Issue: if `CYGWIN=winsymlinks:nativestrict` env var is set, running >> `ln -s target link` completely fails (even though running `mklink link >> target` in `cmd.exe` succeeds, same as `ln -s` does on UNIX). If >> `CYGWIN=winsymlinks:native`, a non-native link is created. > >> So, `nativestrict` might break some (admittedly unorthodox) scripts. >> With `native` these script work, but still a native link would be >> preferrable and it is possible to create, but a non-native link is >> created instead. > >> Bottom line, I think the native symlink creation code should be >> checked and a possibility should be added to create links to >> non-existent targets, rather than the current behavior of failing. > > This is actually an arguable behavior, even in Linux. I can imagine the > behavior is "undefined" in such a case. > But I'll leave final say to the more experienced members of the list. > > > -- > With best regards, > Andrey Repin > Friday, April 29, 2016 01:55:21 > > Sorry for my terrible english... > -- 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