public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ash is wrong about [ -w Temp ], so rebaseall fails
@ 2011-11-30 22:46 Tim McDaniel
  2011-11-30 23:12 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Tim McDaniel @ 2011-11-30 22:46 UTC (permalink / raw)
  To: cygwin

Windows 7, 64-bit, up-to-date Cygwin.

I got "unable to remap to same address as parent" and did a rebaseall.
It failed:

     $ /bin/rebaseall
     rebaseall: '/Users/TMCDAN~1/AppData/Local/Temp' is not writable

I hand-disabled the condition that produced that and did some
testing.  I ran these commands in bash:

$ [[ -d /Users/TMCDAN~1/AppData/Local/Temp ]] && echo yes || echo no
yes

$ [[ -w /Users/TMCDAN~1/AppData/Local/Temp ]] && echo yes || echo no
yes

$ [ -d /Users/TMCDAN~1/AppData/Local/Temp ] && echo yes || echo no
yes

$ [ -w /Users/TMCDAN~1/AppData/Local/Temp ] && echo yes || echo no
yes

$ /bin/ash -c ' [ -d /Users/TMCDAN~1/AppData/Local/Temp ] && echo yes || echo no                                                             '
yes

$ /bin/ash -c ' [ -w /Users/TMCDAN~1/AppData/Local/Temp ] && echo yes || echo no'
no

$ /bin/ash -c ' [ -d /Users/tmcdaniel/AppData/Local/Temp ] && echo yes || echo no'
yes

$ /bin/ash -c ' [ -w /Users/tmcdaniel/AppData/Local/Temp ] && echo yes || echo no'
no

So bash and ash disagree on whether this Temp directory is writable.

$ echo long > /Users/tmcdaniel/AppData/Local/Temp/long
$ echo short > /Users/TMCDAN~1/AppData/Local/Temp/short
$ ash -c 'echo ashlong > /Users/tmcdaniel/AppData/Local/Temp/ashlong'
$ ash -c 'echo ashshort > /Users/TMCDAN~1/AppData/Local/Temp/ashshort'
$ ls -l /Users/tmcdaniel/AppData/Local/Temp/*short* /Users/tmcdaniel/AppData/Local/Temp/*long*
-rw-r--r--+ 1 tmcdaniel Domain Users 8 Nov 30 16:10 /Users/tmcdaniel/AppData/Local/Temp/ashlong
-rw-r--r--+ 1 tmcdaniel Domain Users 9 Nov 30 16:11 /Users/tmcdaniel/AppData/Local/Temp/ashshort
-rw-r--r--+ 1 tmcdaniel Domain Users 5 Nov 30 16:10 /Users/tmcdaniel/AppData/Local/Temp/long
-rw-r--r--+ 1 tmcdaniel Domain Users 6 Nov 30 16:10 /Users/tmcdaniel/AppData/Local/Temp/short

So bash is right about it being writable, and ash is wrong.
(And /Users/tmcdaniel and /Users/TMCDAN~1 do indeed point to the same
directory.)

-- 
Tim McDaniel, tmcd@panix.com

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ash is wrong about [ -w Temp ], so rebaseall fails
  2011-11-30 22:46 ash is wrong about [ -w Temp ], so rebaseall fails Tim McDaniel
@ 2011-11-30 23:12 ` Eric Blake
  2011-12-03 21:51   ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2011-11-30 23:12 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

On 11/30/2011 03:17 PM, Tim McDaniel wrote:
> $ /bin/ash -c ' [ -w /Users/tmcdaniel/AppData/Local/Temp ] && echo yes
> || echo no'
> no
> 
> So bash and ash disagree on whether this Temp directory is writable.

Known limitation in dash - it is going off of just st_mode bits instead
of using faccessat() and honoring ACLs.

My guess is that if you do 'getfacl /Users/tmcdaniel/AppData/Local/Temp'
and 'id', you will find that your current uid and gid are not the owner
of the directory, but do have an ACL granting write access to the
directory anyway.

I've been meaning to do a new build of dash (aka ash), and to force the
use of faccessat as part of that build; I just haven't had the time to
get to it yet.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ash is wrong about [ -w Temp ], so rebaseall fails
  2011-11-30 23:12 ` Eric Blake
@ 2011-12-03 21:51   ` Eric Blake
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Blake @ 2011-12-03 21:51 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

On 11/30/2011 03:45 PM, Eric Blake wrote:

> Known limitation in dash - it is going off of just st_mode bits instead
> of using faccessat() and honoring ACLs.
> 

> I've been meaning to do a new build of dash (aka ash), and to force the
> use of faccessat as part of that build; I just haven't had the time to
> get to it yet.

In fact, upstream dash-0.5.7 already switched to faccessat.  Updated
build coming soon, once I double check all the other outstanding
requests in my queue for dash.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-03 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-30 22:46 ash is wrong about [ -w Temp ], so rebaseall fails Tim McDaniel
2011-11-30 23:12 ` Eric Blake
2011-12-03 21:51   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).