X-Recipient: archive-cygwin@delorie.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:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=qDucqXlOg0rxUK/VmSVuHr6oN9ZDCa17f6aWxTHgN/T
	Zia1sbSZ3ULmIPKXwEdWvwp0vle74ddKFfJtZT8Z5UwjyIcdTYEgNGJHVJniLrZ7
	WGxmIopxOt8UB4caRzAJ/Six5DaFQ2JZo/mKqlYTHt1I5R8+jX3cdFgvY5TSWn5A
	=
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:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=1WNB5pgFxS+CURHx9HraGDMJcIc=; b=RboCnnjmYUfRCevzS
	DNIxvUnmp0Ts1r0H1CZP6oVRKzDZPTugTRPUk1Nl40/uMzcv0FJU4qdEwwmeuDkk
	oSPUxUu0P8CKTnCBBxRhgrwHT7qUhWeo4KUrCMfMLQluchMDYxSmAjpmBqPwj396
	ZLUqGQZ+XnM2yOX/Gq/J3UP5JQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPAM_BODY autolearn=no version=3.3.2
X-HELO: etr-usa.com
Message-ID: <5261762F.30707@etr-usa.com>
Date: Fri, 18 Oct 2013 11:55:59 -0600
From: Warren Young <warren@etr-usa.com>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: lnn, a native symlink wrapper script (Was: fstab not automounting...)
References: <21087.31348.870054.516829@consult.pretender> <20131017093846.GA26304@calimero.vinschen.de> <21087.64099.660195.262020@consult.pretender> <20131017151929.GR18358@calimero.vinschen.de> <21088.45642.198102.464479@consult.pretender> <20131018074744.GD23477@calimero.vinschen.de>
In-Reply-To: <20131018074744.GD23477@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 10/18/2013 01:47, Corinna Vinschen wrote:
>    $ CYGWIN=winsymlinks:native ln -s /path/to/your/fstab /etc/fstab

I've wrapped that in a shell script called lnn ("link native"):

     #!/bin/sh
     CYGWIN=winsymlinks:native ln "$@"

Perhaps Eric Blake will add this to coreutils so we can use the shortcut 
in replies to list questions.

I tried to add a test for the SeCreateSymbolicLinkPrivilege capability 
before attempting to create the link, but this command doesn't DTRT:

	`cygpath -S`/whoami /priv

It doesn't output a line for SeCreateSymbolicLinkPrivilege at all.

The native whoami.exe has an /all flag that *does* show this privilege, 
but you only get a line for the symlink priv when you run it as 
Administrator!  How very medieval: you can't ask Windows what privileges 
you have unless you have lots of privileges already.

Complicating the matter is that whoami claims this privilege is *unset* 
on this machine, though that may be because I asked the question as 
Administrator.  Maybe the privilege doesn't need to be set as admin.

Another oddity is that the /all flag complains when run as non-admin:

	ERROR: Unable to get user claims information.

...but only when run from a Bash shell.  It runs without complaint -- 
though it still remains silent about the symlink priv -- when run from 
cmd.exe or PowerShell.

--
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

