delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/16/09:12:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <42D907BE.5090003@byu.net>
Date: Sat, 16 Jul 2005 07:12:30 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: Barry Demchak <vendors AT tpsoft DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: cannot create temp file for here document
References: <071520051616 DOT 17192 DOT 42D7E14F0006D1840000432822007510900A050E040D0C079D0A AT comcast DOT net> <SERRANOnXuD44kLRMwA000005a0 AT SERRANO DOT CAM DOT ARTIMI DOT COM> <loom DOT 20050715T191819-539 AT post DOT gmane DOT org> <42D83890 DOT 7010908 AT byu DOT net> <6 DOT 2 DOT 0 DOT 14 DOT 2 DOT 20050715182925 DOT 03329460 AT mail DOT tpsoft DOT com>
In-Reply-To: <6.2.0.14.2.20050715182925.03329460@mail.tpsoft.com>
X-IsSubscribed: yes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ugh, top-posting, reformatted.
>> Nope, since you don't define TMPDIR, bash is trying to use /tmp.  And the
>> location of /tmp is probably c:\cygwin\tmp, although you didn't follow
>> the directions to attach cygcheck output, so I can't prove that.
>> 
>> Please show the output of:
>> 
>> $ ls -l / /tmp /cygdrive/c
>> $ getfacl / /tmp /cygdrive/c

Shoot - I meant "ls -ld", to limit the listing to just those three
directories instead of their contents, but it's okay because the
information is still there.

>> 
>> My guess is that there are ACLs at play, so that even though ls shows the
>> directory as writable, an ACL is preventing your user id from actually
>> creating the temp file.
> 
> Please find attached my cygcheck.out file.

Let's see - no CYGWIN variable defined, and win2k, so you are running
ntsec (by default).  /tmp is indeed mounted to c:\cygwin\tmp.  You're
pretty up-to-date on packages.  So far, so good.

>
> Please find attached the "ls -l / /tmp /cygdrive/c" output you
> requested. Note that the error message "ls: /cygdrive/c/pagefile.sys: No
> such file or directory" was printed to stderr immediately after listing
> the "/" directory.

> /:
> drwxr-xr-x   2 bdemchak None    0 Jul 14 23:19 tmp
> /cygdrive/c:
> drwxr-xr-x  11 bdemchak None        0 Jul 14 23:17 Cygwin

Weird, no extra ACLs, which would normally be there when running ntsec.
So those directories are indeed writable by only the bdemchak user, and it
seems like it should succeed.

>
> Please find attached the "getfacl / /tmp /cygdrive/c" output you requested.

This confirms that there are no additional ACLs, so that strikes my theory
that bash was misinterpreting permissions.  Perhaps someone else can
deduce what's going wrong?

> Please find attached the "bash -xv" output you requested.

It looks like your trace cut off the first few lines of execution of
/etc/profile, but that's okay; it still included all the useful
information.  The result of bash not being able to create the temp file is
that none of the /etc/profile.d/*.sh scripts are being run at login.

> There's more, though ... as I collected this information, I noticed a
> very peculiar effect that I'm betting has something to do with this. If
> I "ls >foo", I'm fine. If I "unlink foo", foo gets deleted, but I also
> get a spurious error message:
>
> bdemchak AT malex ~
> $ unlink foo
> unlink foo
> + unlink foo
> unlink: cannot unlink `foo': No such file or directory
>
> Like I said, foo gets deleted, but then there's the error message. This
> smells like it's all tied together, but I can't quite put my finger on it.

Odd, and yes it might be related.  This time, it would be nice to have the
strace_unlink.out file from "strace -o strace_unlink.out unlink foo".  An
strace of bash would also be nice, but because it is so big, try the
following to prune it to just the locations where bash tries to open its
temporary file (bash uses the prefix sh-thd for all temporary here-doc
files), then just attach strace_bash_lite.out to your reply:

$ strace -o strace_bash_full.out bash -li
$ exit
$ grep -C 20 sh-thd strace_bash_full.out > strace_bash_lite.out

>
> FYI, I *can* create files in tmp using "cat >foo" ... no permission
> violation or any other error ... works fine.

I'm assuming you did that from within /tmp, and >foo is taken care of by
bash.  So I have no idea why bash can create /tmp/foo and not temporary files.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC2Qe984KuGfSFAYARAmwAAJwO1h2OaedeMrxriqUA/KbSq2fGLwCg005C
7UtazvgRPZR7QZN7Mp4217s=
=1wgA
-----END PGP SIGNATURE-----

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019