Subject: Re: cannot create temp file for here document
From: [email-masked] (Eric Blake)
To: Barry Demchak <[email-masked]>
Cc: [email-masked]
Date: Sat, 16 Jul 2005 23:00:40 +0000

> 
> Attached please find the strace_unlink.out you requested. To get this, I 
> started Cygwin and did the following:
> 
> cd /tmp
> cat >foo
> blah blah blah ^Z
> strace -o strace_unlink.out unlink foo
> 
> Looking at the trace, I can see where unlink returns a 2, which would give 
> the error ... but unlink also deletes the file (I checked). I checked the 
> Win32 documentation on unlink (both on CD and at MSDN) and there are no 
> indications of weirdness.

That is bizarre, but you are probably right that it has to do with
the fact that you are on an NT machine but with a FAT file system.
I'll defer to the primary cygwin developers to see if they agree.

> 
> Attached please find the strace_bash_lite.out dump as requested. I executed 
> this from the /tmp directory, too.
> 
> Looking at the track, I can see the same unlink failure as in the unlink trace.
> 
> When I create foo in the /tmp directory and then do an ls -l on it, I get:
> 
> -rw-r--r--  1 bdemchak None 15 Jul 16 11:20 foo
> 
> Windows claims that the owner is "Everyone", which is a virtual group that 
> supposedly really does contain everyone.
> 
> I can add only a few tidbits.
> 
> One is to point out that this partition is a FAT32 partition ... one 
> wonders if there may be problems because it's not an NTFS partition. 
> Considering that it's my boot partition, I would change it ... but not 
> lightly ... and only with very good reason (which this might be).

FAT has very little in its favor - it has no file permissions to speak
of, can't do hard links, and in general is not as powerful as NTFS.
Upgrading certainly would improve the situation.

> 
> In playing around with this, I'm getting the feeling that cygwin maintains 
> a shadow permission list for each file. My best guess right now is that 
> this shadow list (if it exists) is getting out of sync with the Windows 
> directory contents. Were this the case, cygwin might be relying on the 
> shadow list for part of an operation (like unlink) and Windows for another. 
> If the two are out of sink, we'd see something like what we're seeing.

No, cygwin uses Windows notions of permissions, which are keyed
to Windows SID, and maps that to POSIX permissions.  If Windows
can't report the correct permissions (and remember, FAT drives
don't store full permissions like NTFS does), then cygwin can't improve
the situation.   As to editing your passwd file, as long as you leave
SIDs alone, you should be able to edit user name, group id, and
preferred shell without any adverse effects.  See
http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html#ntsec

> 
> Does this lead you anywhere??
> 
> Thanks!

Hope I've been some help.

--
Eric Blake

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/