This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cannot create temp file for here document


-----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@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@byu.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]