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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; q=dns; s=default; b=qO YlpPkOE2dvLLyRd8EewC2CNv/YmorPWZV4cBmMtokavP/vFCCkNqehim+ERgw8xH rRKP0svRA6GtGi5drNl6eeae7WRikh2oqoywKG6qYFWIf0d3dbqC1LNBcPzE8A5O ywsvrXUhD/j/Qp2dDml3BSSn7JMadaHO4QE+EkFKs= 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:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; s=default; bh=4Ixp8rpy /Xo02vKP6a1+aPozJow=; b=EOpJ1phtNnKl3fff8sPZzduG9rW7+XJYfeZfcVAX giSpr0HxBW+CSupYoy4KRExnmxWvGR0A8NN/2WLK8B0FHKTfeOX1DXb9gjTWzTB9 ffYvKxC3ygKGNuYDqXMO7fC7U/SmcRvQGnTontlHH/s8oo0tXOedkXdY6Fi7QiOO iso= 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-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=anrdaemon AT yandex DOT ru, anrdaemonyandexru, U*gene.pavlovsky, sk:gene.pa X-HELO: mail-ig0-f196.google.com 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=nsD5O6n+l7m9nHRtlUBLQUlnUoYmFaASFKFQUSMKQFk=; b=mEeYqYF136avQALV313G/5KII3Js5PEfTszvKKSbrBYT/UJLX7Z790RxJJ1FZZuEjq R3fgB5YCk+X1XIpL0MmAxH9cVhzSJuucgvM7LkWn++iACiQGNlR94GinBQG0qSp5Mq9i gK5jbM9JrdIacnUi3tooYRge+GA5OUhtdeBpMTpp70NVX+oV3fVINyPwRCPSGFovG0Kf z47OGrhqArjaH06gzGnj6wli3Clfn+7GuUEFPNSMGGBu0FVf+YjmrJg3ScTDhD+6ziWQ pB8C46skoCtwWZWvWp9Z8GuEnfXqmCQ52hRGg/XzRp85+IakJDcw+y4bFybTDaSC9W3C Sl9w== X-Gm-Message-State: AOPr4FXY3qXMCVFY9hnPxFRQpFeN+1NnuVxQAjPFxbLxZIaGi2654QkhEB3PejnV9FAKIS8Y1/99qn4rtWbCHQ== MIME-Version: 1.0 X-Received: by 10.50.60.68 with SMTP id f4mr885035igr.34.1461888556260; Thu, 28 Apr 2016 17:09:16 -0700 (PDT) In-Reply-To: References: <1606116423 DOT 20160429020650 AT yandex DOT ru> Date: Fri, 29 Apr 2016 03:09:16 +0300 Message-ID: Subject: Re: `CYGWIN=winsymlinks:nativestrict`, `ln -s target link` fails if target doesn't exist From: Gene Pavlovsky To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 The list of errors that might be returned by symlink(2) mention target only 3 times: EFAULT target or linkpath points outside your accessible address space. ENAMETOOLONG target or linkpath was too long. ENOENT A directory component in linkpath does not exist or is a dangling symbolic link, or target or linkpath is an empty string. So my understanding is: target must be non-empty, not too long, and don't point outside the accessible address space. Nothing about existence. --Gene On 29 April 2016 at 03:05, Gene Pavlovsky wrote: > 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