Postinstall for mintty fails when installing "just for me"

Andy Koppe andy.koppe@gmail.com
Wed Aug 18 11:24:00 GMT 2010


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 error 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\Administrators:(OI)(CI)F
>>                                                         CREATOR OWNER:(OI)(CI)(IO)F
>>                                                         NT AUTHORITY\SYSTEM:(OI)(CI)F
>>                                                         BUILTIN\Users:(OI)(CI)R
>>[...]
>
> Here's the actual problem:
>
>  cygdrive prefix     /         system  binary,noacl,posix=0,auto
>
> The cygdrive prefix is set to the mount option "noacl".  So the output
> 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.  However, 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.  Like this:
>
>  PROGS=/tmp/.mintty-postinstall-$$
>  mount -f "`cygpath -APm`" $PROGS
>  if [ -w "$PROGS" ]; then
>    [...]
>  else
>    [...]
>  fi
>  umount $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



More information about the Cygwin mailing list