delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/08/18/07:24:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_YG,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20100818084323.GN11340@calimero.vinschen.de>
References: <0105D5C1E0353146B1B222348B0411A20945256668 AT NIHMLBX02 DOT nih DOT gov> <AANLkTinZ+a6w71LKGUvoytvJBNONeC6kYMweTjCUXN-R AT mail DOT gmail DOT com> <20100817084858 DOT GA16404 AT calimero DOT vinschen DOT de> <0105D5C1E0353146B1B222348B0411A2094525666F AT NIHMLBX02 DOT nih DOT gov> <20100818084323 DOT GN11340 AT calimero DOT vinschen DOT de>
Date: Wed, 18 Aug 2010 12:24:19 +0100
Message-ID: <AANLkTimQ1t1KVxEFVpyDBS3_uoxYwhoAqp4Ln6bTrJmP@mail.gmail.com>
Subject: Re: Postinstall for mintty fails when installing "just for me"
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
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 18 August 2010 09:43, Corinna Vinschen wrote:
> On Aug 17 15:12, Buchbinder, Barry (NIH/NIAID) [E] wrote:
>> Corinna Vinschen sent the following at Tuesday, August 17, 2010 4:49 AM
>> >> On 17 August 2010 02:26, Buchbinder, Barry wrote:
>> >> > $ bash --norc --noprofile /etc/postinstall/mintty.sh
>> >> > /bin/mkdir: cannot create directory `/c/Documents and Settings/All
>> >> > Users/Start Menu/Programs/Cygwin': Permission denied
>> >> > mkshortcut: Saving "C:\Documents and Settings\All Users\Start Menu\=
Programs\Cygwin\mintty.lnk" failed; does the target directory exist?
>> >> > /bin/chmod: cannot access `/c/Documents and Settings/All Users/Start
>> >> > Menu/Programs/Cygwin/mintty.lnk': No such file or directory echo $?
>> >> > 1
>> >[...]
>> >The problem is, we don't know anything about your environment, Barry.
>> >cygcheck output as requested by http://cygwin.com/problems.html would be
>> >helpful, perhaps.
>>
>> Attached.
>>
>> Please note:
>>
>> $ cygcheck -s -v -r > cygcheck.out
>> /usr/bin/cygrunsrv: warning: OpenService failed for 'TapiSrv': Win32 err=
or 5
>> Access is denied.
>
> That usually just means you don't have admin privs.
>
>>
>> >As is getfacl/cacls output for the "/c/Documents and
>> >Settings/All Users/Start Menu/Programs" directory.
>>
>> $ getfacl '/c/Documents and Settings/All Users/Start Menu/Programs'
>> # file: /c/Documents and Settings/All Users/Start Menu/Programs
>> # owner: BBuchbinder
>> # group: Domain Users
>> user::rwx
>> group::r-x
>> other:r-x
>> mask:rwx
>>
>> $ cacls 'C:\Documents and Settings\All Users\Start Menu\Programs'
>> C:\Documents and Settings\All Users\Start Menu\Programs BUILTIN\Administ=
rators:(OI)(CI)F
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CREATOR OWNER:(OI)(CI)=
(IO)F
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NT AUTHORITY\SYSTEM:(O=
I)(CI)F
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 BUILTIN\Users:(OI)(CI)R
>>[...]
>
> Here's the actual problem:
>
> =C2=A0cygdrive prefix =C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 system =
=C2=A0binary,noacl,posix=3D0,auto
>
> The cygdrive prefix is set to the mount option "noacl". =C2=A0So the outp=
ut
> from getfacl or ls or stat for this directory shows just fake
> permissions based on the DOS R/O flag.

Thanks very much for spotting that.


> You're not an admin, so you're not allowed to write to this directory,
> see the cacls output. =C2=A0However, since the cygdrive prefix is mounted
> with "noacl", Cygwin tools just don't know it.
>
> Andy, to workaround this, you *could* create a user mount first which
> has no "noacl", then use the user mount to check permissions, and
> eventually umount again. =C2=A0Like this:
>
> =C2=A0PROGS=3D/tmp/.mintty-postinstall-$$
> =C2=A0mount -f "`cygpath -APm`" $PROGS
> =C2=A0if [ -w "$PROGS" ]; then
> =C2=A0 =C2=A0[...]
> =C2=A0else
> =C2=A0 =C2=A0[...]
> =C2=A0fi
> =C2=A0umount $PROGS

Hmm, I'm a bit afraid that might find creative new ways of going wrong. ;)

I think I'll go with your previous suggestion of just going ahead and
trying to create the 'All Users' shortcut and falling back to the
user's start menu if that fails.

Although, perhaps there's a way to tell from $CYGWINROOT whether we're
dealing with an install for all users or "just me"?

Andy

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