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: <0105D5C1E0353146B1B222348B0411A2094525666F@NIHMLBX02.nih.gov> References: <0105D5C1E0353146B1B222348B0411A20945256668 AT NIHMLBX02 DOT nih DOT gov> <20100817084858 DOT GA16404 AT calimero DOT vinschen DOT de> <0105D5C1E0353146B1B222348B0411A2094525666F AT NIHMLBX02 DOT nih DOT gov> Date: Wed, 18 Aug 2010 07:00:10 +0100 Message-ID: Subject: Re: Postinstall for mintty fails when installing "just for me" From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On 17 August 2010 20:12, Buchbinder, Barry (NIH/NIAID) [E] wrote: > Corinna Vinschen sent the following at Tuesday, August 17, 2010 4:49 AM >>On Aug 17 06:52, Andy Koppe wrote: >>> 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\Pr= ograms\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 >>> >>> Hmm, the test at the top of the script is meant to avoid that, by >>> checking whether the 'All Users/Start Menu/Programs' folder is >>> writable. Any idea why that's saying yes when apparently it isn't >>> writable? >> >>I tried your script and it works fine for me. If I'm running as admin in >>a UAC-restricted shell, the test fails as expected. >> >>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. Thanks. > Please note: > > $ cygcheck -s -v -r > cygcheck.out > /usr/bin/cygrunsrv: warning: OpenService failed for 'TapiSrv': Win32 erro= r 5 > Access is denied. > >>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 Hmm, so you've got 'rwx' permissions on that directory yet you can't create a directory in it. That just leaves me puzzled. > $ cacls 'C:\Documents and Settings\All Users\Start Menu\Programs' > C:\Documents and Settings\All Users\Start Menu\Programs BUILTIN\Administr= ators:(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=A0CREATOR 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=A0NT AUTHORITY\SYSTEM:(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=A0BUILTIN\Users:(OI)(CI)R Not knowing enough about ACLs: does the BUILTIN\Users, which says read-only, override the CREATOR OWNER entry, which grants full access? >>> Is there a proper way for a postinstall script to find out whether >>> it's an install for all users or "Just Me"? >> >>Hmm, afaik no. >> >>You could try to write to All Users first and if that fails, write to >>the user's own Programs. Sounds like the way to go (for the moment anyway), especially now that mkshortcut correctly reports success. >>But, maybe we should define a couple of useful, installation-specific >>arguments for postinstall scripts and change setup accordingly? I think that would be useful. Looking at the source in script.cc, the Cygwin root is passed as a variable already. > I should have started by saying that, as a practical matter, this > is not a problem for me. =C2=A0I have a minty shortcut and renaming > /etc/postinstall/minty.sh to /etc/postinstall/minty.sh.done stops > the error message from coming up. Yep, that's the right workaround. > And thanks for this upgrade of setup. =C2=A0For some time now the > "pending" view had the same two empty packages appear each time > I ran setup. =C2=A0Very annoying. =C2=A0Now, they no longer show up. Dave Korn fixed that one. A relief indeed. 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