delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/06/04:41:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 6 May 2010 10:41:02 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: V1.7 and endless loops triggerd by junction points
Message-ID: <20100506084102.GV1845@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <hrpqso$d9f$1 AT dough DOT gmane DOT org> <u2y416096c61005042221o11adc9e9k9a1012491e672880 AT mail DOT gmail DOT com> <20100505083010 DOT GS1845 AT calimero DOT vinschen DOT de> <hrsg3t$os1$1 AT dough DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <hrsg3t$os1$1@dough.gmane.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On May  5 21:15, Matthias Meyer wrote:
> Corinna Vinschen wrote:
> > Otherwise, the only difference as far as I can see is the fact that the
> > user token attrib inherited from the Cygwin shell has more user rights
> > enabled.  Namely the backup and restore rights, which allows to access
> > files and directories which are not available by default.  However, this
> > only works in an elevated shell, too.
> > 
> > However, it's not Cygwin's fault that attrib is not up to speed with
> > circular symlinks on an OS which allows them.
> > 
> It seems to be the backup and restore rights. I can run a cmd as
> administrator and attrib don't run into the endless loop.
> Also I can run sh from a normal user and attrib will work right.
> Only if I run attrib within a process with the backup and restore rights
> attrib will run into this endless loop :-(

There's a workaround for you, the cygdrop tool, part of the cygutils
package.

Here's an example:

  elevated bash$ cd /cygdrive/c/Users/All\ Users

  elevated bash$ attrib Desktop
      HR       C:\ProgramData\Desktop

  elevated bash$ attrib Desktop\\Cygwin.lnk
  A            C:\ProgramData\Desktop\Cygwin.lnk

  elevated bash$ cygdrop -p SeBackupPrivilege /cygdrive/c/Windows/System32/attrib -p Desktop\\Cygwin.lnk
  File not found - Desktop\Cygwin.lnk

Unfortunately you have to use the full path to attrib to make it work
since cygdrop doesn't perform a path search.

Still, it's Windows' own attrib command which fails because it doesn't
take extended user rights into account.  That's a bug in attrib, not
in Cygwin.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019