RE: chere not seeing my preferred $HOME

2016-06-30 Thread Rainer Blome
> Gesendet: Donnerstag, 30. Juni 2016 um 21:55 Uhr
> Von: "Nellis, Kenneth"
> Hello. http://www.cygwin.com/acronyms/#PCYMTNQREAIYR

Sorry, forgot, thanks for pointing it out.
  
> I simply want chere to run my .profile before it presents
> me with the bash prompt.

How to achieve that depends on your shell.
For example, .bash_profile is not read for every bash instance.
See section INVOCATION of `man bash`, where details are
given which file is read when (or not).
My solution is to conditionally read `.profile` from the shell-specific
`.XYZshrc` file. See a part of my `.bashrc` below, as an appendix.

> I guess the problem is knowing how to tell chere what
> my Cygwin $HOME is.

My understanding is that for the same cygwin user,
$HOME should always have the same value,
regardless of where you used "Bash Prompt Here".
Clicking that in C:\cygwin\etc yields a shell that behaves
like this for me:

/etc> echo $HOME
/cygdrive/c/blome # That's what I have configured.

> Using the word "domain" generically, there is my Windows
> domain ($HOME is C:\Users\KNellis) and my Cygwin domain
> ($HOME is C:\cygwin\home\knellis).

I think I still don't understand what you mean by domain.

> > > Hoping I can keep the two domains separate.

And I'm not sure what you mean by "keep separate".
The paths you gave above are directories, which are obviously
(hopefully ;-) already separate.

Under Cygwin, in a shell, $HOME should have a value with slashes,
`/home/knellis` in your case, true?

In a windows terminal ("Command Prompt"), `$HOME` does not
refer to an environment variable (those would use `%XYZ%`).
For me, the environment variable named HOME is not set.
`echo %HOME%` yields literally `echo %HOME%`.
Looking through the output of `set`, there are two variables
that contain my windows user's home directory, HOMEPATH
(without the drive letter) and USERPROFILE.

> chere appears to be using my Windows domain,

That would be surprising indeed.

> which doesn't have a .bash_profile,
> but I'd like it to use my Cygwin domain.

> > > chere> echo $HOME; cygpath -w $HOME
> > > /cygdrive/c/Users/KNellis
> > > C:\Users\KNellis

What does "chere" mean here?
How exactly did you get this shell?
Which commands did you type, what did you click?

Repeat: 
> > How come you have differing values for $HOME in some contexts?
> Different domains.
In the context of my above questions, can you give a more precise answer?

Rainer 



# Regarding initialization files, Bash knows 3 different shells:
# o A "normal", non-interactive shell, such as in "bash -c 'echo Hello'",
#   does not load any file.
# o An interactive shell, one that reads commands from a terminal, is
#   supposed to read "~/.bashrc".
# o A login shell is supposed to read "~/.profile".

# When an interactive login shell is started, Bash loads the .bashrc
# first, then the .profile.

# 
#debug="true";
note() { echo 1>&2 "$@"; }
c() { if [ ! "" = "${debug-}" ]; then note "$*"; fi; }

# Reentrance handling

if [ ! "" = "${home_bashrc_was_read-}" ]; then
c ".bashrc: Warning, .bashrc reentered (possible recursion).";

# FIXME: Simply continuing would make it easier to reload this file.

if [ "" = "${debug-}" ]; then
c ".bashrc stopped.";
return 0;
else
c "Continuing .bashrc (because we are in debug mode).";
fi;
fi;

# Keep this here, don't move it to the end of the file.
# We just want to know whether it was tried to read
# this, not whether it was successful.
home_bashrc_was_read="true";# Do not export this!

c .bashrc running...

# 
# FIXME: This assumes that the $HOME value is valid, which it may not
# be.  For example, on Windows, $HOME may be "C:/" instead of anything
# actually user-specific.

if [ "" = "${HOME_PROFILE_WAS_READ-}" ]; then
c ".bashrc: Sourcing '.profile'...";
. "$HOME/.profile";
c ".bashrc: Sourced '.profile'.";
fi;


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



Aw: chere not seeing my preferred $HOME

2016-06-30 Thread Rainer Blome
Hi Kenneth,

not sure what you are aiming for here.

Gesendet: Donnerstag, 30. Juni 2016 um 20:18 Uhr
Von: "Nellis, Kenneth" 
> how to configure chere so that it runs my 
> .bash_profile in my regular Cygwin home:

The purpose of `chere` is, quoting from its help,
to "to right click a folder in Windows Explorer and
open a Cygwin shell *in that folder*."

Your `.bash_profile` should run in whatever directory
it is called from. To refer to a file in your $HOME,
explicitly do so (by prefixing any path with $HOME).

> Hoping I can keep the two domains separate.

What kind of domains do you mean?

> chere> echo $HOME; cygpath -w $HOME
> /cygdrive/c/Users/KNellis
> C:\Users\KNellis

How come you have differing values for $HOME in some contexts?
Do you have two separate Cygwin installs?
Two home directories?
Where does the "chere" prompt stem from?

Regards, Rainer

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



/etc/X11/app-defaults/XTerm refers to font "helvetica"

2016-06-30 Thread Rainer Blome
Since many months (and probably several Cygwin and X11 releases),
starting `xterm` triggers the following annoying warning (xterm starts fine 
otherwise):

 xterm &
 Warning: Cannot convert string 
"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-*" to type FontStruct

I have grepped for "helvetica" through my own config files (`.Xdefaults` etc.) 
and not found such a font reference.

The mailing list archives show that at least one other Cygwin user has 
encountered the same issue,
and got no answer regarding this specific issue (just for another font issue).
https://sourceware.org/ml/cygwin/2015-09/msg00184.html
https://sourceware.org/cgi-bin/search.cgi?wm=wrd=extended=all=D=%2Fml%2Fcygwin%2F%25=helvetica
At first glance, internet search provides only less relevant hits.

It looks like the cause is in file `/etc/X11/app-defaults/XTerm`, in the 
following line:

 *SimpleMenu*menuLabel.font: 
-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-*

When I comment out that line (using "!"), xterm starts without any warnings.

I do not recall having added that line myself, so I assume that it is part of 
its default content.
Are users expected to maintain that file?

Regards, Rainer

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



Re: chmod failed: Invalid argument

2016-02-10 Thread Rainer Blome
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 08.02.2016 15:29, Corinna Vinschen wrote:
> On Jan 31 21:24, Rainer Blome wrote:
>> On 28.01.2016 21:40, Corinna Vinschen wrote:
>>>>> On a hunch, do you have old /etc/passwd and /etc/group
>>>>> files
>>>> There is no `/etc/group`, but `/etc/passwd` defines the
>>>> group ID of my user as 513
>> On a Cygwin 2.3.1 on a different machine, `/etc/passwd` also has 
>> 513 in the group column of all users. Yet, when I ask for `id`,
>> I get something like this (translated):
>> 
>> uid=197609(username) gid=197121(None) \ 
>> Groups=197121(None),545(Users),...
> 
> These values make sense.

Please enlighten me. To me it looks as if cygwin or at least mkpasswd
formerly used 513 as the gid for "None", and switched to 197121 at
some point.

I currently do not understand this:

Before I changed gid of my user from 513 to 197121 in /etc/passwd, ls
printed 513 as the group of files in the home directory. After the
change, ls prints "None" as the group. But 197121 is the id of None.
At first sight, this looks like the file group ownership has changed
from 513 to 197121, but I do not see why that should have happened.

>> No doubt. So what kind of maintenance do these files need? Should
>> I have known that they do?
> 
> They should match.  For instance, one problem is if your passwd 
> entry contains a gid not available in either the Windows user DB
> or /etc/group.

Does this mean that if /etc/passwd exists, /etc/group must also exist
(and match)? Or that, if /etc/passwd gives a currently-non-canonical
gid such as 513, /etc/group must exist and define that gid?

Regards, Rainer
-BEGIN PGP SIGNATURE-

iQIcBAEBCAAGBQJWuxgTAAoJEI/iM7d3pEsvXnEQAMv8VT5Frv9uvVt7kMuu1SA/
G5K0AnuzS3XCZIZzVgOHls+6XrbOLXVLi6BCf7i2bFm9tBhsT7/U+X4/hfMTMUuz
OsefO6EHmGr+c8jEzm9y2OpU10zf+rsOqgFMD7qnUoJ2kbpUNY+dGKnUOYsQmnZ/
gdUlufQTpAoMsNiEsTlseaiXdGiSS6pCNu7W0HrIn7TI8uPCAxA7zqi5S53a3zpQ
4x7E4+0QS3KxLT5C20RWRhGEx/+efUAWH/G/UJNEdZJ+hc5eG4Abz4Bh7wx0ITuJ
FabuktphYS1RuRxEPJgNpLdUtCervWzNe223aHdcHR+lJygPCcKHBII6h1kU6tiK
vjpvG5wyDvWFewBoAqD3uWwYwo+tMaRMj3rSMXApRcO5IHDgid54Bi7ETwxurfO0
0cMHKuRNsGTO1BZXfZJZBChKRkDDYoF165TvMMMYTop2hUwcGJVl06s48dRnNfc9
h5tgqB3IKBgDb2I1D6GK/yjkMNIH5x9J9Z51qXKFhWs2erosndLy2K0MUk8i23Je
YqYbucBZ+6ynoRKUfUzjtJNL062ZxfBoQHpPJ9PJHJQluagFdkkeBsbxZhdrtYnj
6PNWqTTYWGm+V8Un+LwSqEr1rPDcMtPBkWTxSnjdnBL3iSd85FgXaVrcM+Lc2ptp
Ud3/WslWQqlC69NdFiRK
=kX/M
-END PGP SIGNATURE-

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



Re: 2.4.1 - Issue with strace

2016-02-07 Thread Rainer Blome
On 06.02.2016 21:02, Evgeny Morzov wrote:
> Hello,
> 
> I have problem running strace. Does anybody have similar thing going on?
> 

Hi Evgeny,

strace can currently fail altogether when /etc/passwd contains entries
with "invalid" group ids. If `id` or `ls` show numerical ids instead of
group names, that is likely to be the case.

http://cygwin.org/ml/cygwin/2016-01/msg00491.html

Rainer

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



Re: 2.4.1 - Issue with strace

2016-02-07 Thread Rainer Blome
On February 7, 2016 11:23:06 AM CET, Evgeny Morozov <mail@gmail.com> wrote:
>07.02.2016 12:12, Rainer Blome пишет:
>> strace can currently fail altogether when /etc/passwd contains
>entries
>> with "invalid" group ids. If `id` or `ls` show numerical ids instead
>of
>> group names, that is likely to be the case.
>
> I
>did not even have the /etc/passwd before. I did create it along with
>/etc/group using mkpasswd and mkgroup, but strace does not work still.

My understanding is that you should only create these if you know that you need 
them. Since creating then did not help, I would remove them.

>ls an id return group names, although the group is named "Missing", I
>am
>not sure why:
>
>$ ls -la
>итого 45
>drwxrwxrwt+ 1 tyz Отсутствует  0 дек  3 20:57 .
>drwxr-xr-x+ 1 tyz Отсутствует  0 фев  6 22:24 ..
>drwxr-xr-x+ 1 tyz Отсутствует  0 фев  7 13:00 tyz
>
>$ id
>uid=197614(tyz) gid=197121(Отсутствует)

The group with id 197121 is named "None" on my system. It appears to be the 
default group used by Cygwin for users and files.

>группы=197121(Отсутствует),114(Локальная учетная запись и член группы
>"Администраторы"),544(Администраторы),545(Пользователи),4(ИНТЕРАКТИВНЫЕ),66049(КОНСОЛЬНЫЙ
>ВХОД),11(Прошедшие проверку),15(Данная организация),113(Локальная
>учетная запись),4095(CurrentSession),66048(ЛОКАЛЬНЫЕ),262154(Проверка
>подлинности NTLM),405504(Высокий обязательный уровень)
>
>I have attached my passwd and group file in case they are of any help.
>
>Thank you a lot,
>Evgeny
>
>
>
>
>--
>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



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



Re: chmod failed: Invalid argument

2016-01-31 Thread Rainer Blome
On 28.01.2016 21:40, Corinna Vinschen wrote:
> On Jan 28 19:43, Rainer Blome wrote:
>>> Corinna Vinschen wrote 2016-01-28 18:22:
>>>> On Jan 28 17:06, Rainer Blome wrote:
>>>>> Corinna Vinschen wrote 2016-01-28 15-44: And then, what about
>>>>> this unknwon group with gid 213?  What does
>>>>> 
>>>>> $ getent group 213
>>>>> 
>>>>> print?  Something's weird here...
>>>> 
>>>> getent group 213; echo $? # getent prints nothing, returns 2
>>>> 
>>> On a hunch, do you have old /etc/passwd and /etc/group files by
>>> any chance?  Does moving them out of /etc (don't delete them for
>>> now!), exiting from Cygwin and starting a new shell somehow fix
>>> things for you? How do the files look like?
>> 
>> Define "old"! ;-) Yes, I do. There is no `/etc/group`, but 
>> `/etc/passwd` defines the group ID of my user as 213 (the real ID
>> is a bit different, to be honest, but I do not think that 
>> matters.)

The real group ID is 513, by the way. On a Cygwin 2.3.1 on a different
machine, `/etc/passwd` also has 513 in the group column of all users.
Yet, when I ask for `id`, I get something like this (translated):

 uid=197609(username) gid=197121(None) \
  Groups=197121(None),545(Users),...

> Ouch, that may be the reason.  I have to check that but your passwd
> and group files are
> 
> 1) Not required anymore, see 
> https://cygwin.com/cygwin-ug-net/ntsec.htm, and

Well, I do not use Active Directory, and I try to maintain a stable
home directory across new machines, drives or Windows reinstalls,
so I specify this directory in `/etc/passwd`. Since it is small,
I see no harm in using this method.

On my Cygwin 2.4.1, to get things to run the way I want them, I
renamed `/etc/passwd.renamed` back to `/etc/passwd`, and replaced
the old group id by the ID of group "None", 197121.
In a new terminal, things now run as expected, SSH finds its .ssh
directory and `chmod` etc. work the way that they should.

> 2) *iff* they are there, there's good reason to have them in a good
> working shape.

No doubt. So what kind of maintenance do these files need?
Should I have known that they do?

>> The `git clone repo:bar` then fails because my `~/.ssh` is 
>> apparently no longer found (and I can only log in via SSH key). 
>> This is a bit surprising, because in the new terminal, `$HOME` and
>> `~/.` are still set the way I specified it in the old `/etc/passwd`
>> (now with extension `.renamed`).  So some programs apparently use
>> one method of determining the home directory, and others use a
>> different method. I will look into that tomorrow.
> 
> Yes, indeed.  Ssh ignores $HOME and it does so as long as it exists.
> Ssh uses the pw_dir field from your passwd entry and that in turn is
> determined by /etc/passwd if it exists, or by /etc/nsswitch.conf. See
> the extensive documentation starting at 
> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch 
> The default homedir is /home/.  There are a few knobs to 
> play with to change this setting, see 
> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch-home

In the User-specific Windows environment variables, `$HOME` was
set, so that most programs still saw that. To simplify, I removed
that setting, hoping I did not use it in some Windows batch file. :-)

>> If, after this "breakthrough", there is still value in looking 
>> further into the ACLs, I am willing to do that.
> it might not be required anymore to generate the strace at all.

Then I'll skip that for now. Maybe a bogus group setting in
`/etc/passwd` is enough to reproduce the issue.

>> Thanks for the help so far.
> 
> Thanks for *your* help.  I expect there are still a few problems in
> that code since not even a multi-month testphase finds all problems.

I am curious what change triggered the issue, can you point me to a
commit or change-log entry?

Rainer

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



Re: git gui won't run: error: git-gui died of signal 11

2016-01-31 Thread Rainer Blome
On 29.01.2016 03:04, Matt Seitz wrote:
> When I try to run "git gui" I get the following error:
> 
> Matt@hp /cygdrive/c/Users/Matt
> $ git gui 
> error: git-gui died of signal 11
> 
> Log files attached.

It looks like you called `git gui` from your home directory.
That is unusual - is your entire home directory a git repo?
If not, what happens when you call git gui from inside an existing git repo?

That stack trace is mostly empty, no frames to see inside.
Looks like it crashed early, or something went wrong
with writing the stack trace itself.

Recently, I had an issue with Cygwin git, too. It was triggered
by an outdated /etc/passwd file. If you have one, try renaming
that temporarily, start a new Cygwin session and see if that helps.


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



Aw: Re: chmod failed: Invalid argument

2016-01-28 Thread Rainer Blome
> Corinna Vinschen wrote 2016-01-28 15-44:
> On Jan 28 15:24, Rainer Blome wrote:
>
> The "In-Reply-To" is still missing in your mails, so you're invariably
> breaking threading.  T'would be nice if you could make your mailer
> behave :)

This is the first time that I have a mail to reply to,
hope the threading is preserved now.
 
> > > Corinna Vinschen wrote:
> > > On Jan 28 01:27, Christopher Cobb wrote:
> > >> Or maybe chmod is broken, like it is on my machine:
> > >> $ chmod 777 x
> > >> chmod: changing permissions of âxâ: Invalid argument
> > 
> > > Can you please send the icacls output of the current directory and
> > > the icacls out for the file x?
> > 
> > Here are the icacls outputs for the test case:
> > 
> > $ umask
> > 0027
> > 
> > $ mkdir bar
> > $ cd bar
> > $ icacls .
> > . hostname\username:(I)(OI)(CI)(F)
> 
> This... doesn't look like an ACL created by Cygwin.


$ type mkdir
mkdir is hashed (/usr/bin/mkdir)
$ md5sum /usr/bin/mkdir
25471314acd68f352523ba17eafbb7f9 */usr/bin/mkdir


> If you're running Cygwin 2.4.1,

CYGWIN_NT-6.1 hostname 2.4.1(0.293/5/3) 2016-01-24 11:26 x86_64 Cygwin

> the acl should always at least contain ACEs for the
> default POSIX perms, plus a NULL ACE:
> 
> foo NULL SID:(DENY)(Rc,S)
> VINSCHEN\corinna:(R,W,D,WDAC,WO)
> VINSCHEN\vinschen:(R)
> Everyone:(Rc,S,RA)

In Windows Explorer -> `bar` -> RMB -> Properties -> Security ->
Advanced, I am told that it inherits ist permissions from `base`,
the parent of `bar`. (To be precise, it inherits from its
grandparent, but I assume that the length of the ancestor chain is
not important here.)

> For directories also inheritable default perms for "CREATOR OWNER" and
> "CREATOR GROUP".  Is that really a Cygwin mkdir?!?

As far as can see, yes, see above.

> And then, what about
> this unknwon group with gid 213?  What does
> 
>   $ getent group 213
> 
> print?  Something's weird here...

getent group 213; echo $?
2

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



Aw: Re: git clone fails with: error: chmod on config.lock failed: Invalid argument

2016-01-28 Thread Rainer Blome
> Gesendet: Donnerstag, 28. Januar 2016 um 15:33 Uhr
> Von: "Corinna Vinschen" 
> Also, an strace of chmod, e.g.
> 
>   $ strace -o chmod.strace chmod 777 x
> 
> might be helpful.  Please send the file chmod.strace with your reply.

$ strace -o chmod.strace chmod 777 foo
Segmentation fault

$ ls -la
total 0
drwx--+ 1 username 213 0 Jan 28 17:09 .
drwx--+ 1 username 213 0 Jan 28 15:14 ..
-rwx--  1 username 213 0 Jan 28 17:09 chmod.strace
-rwx--  1 username 213 0 Jan 28 15:14 foo

Ragards, Rainer

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



Re: chmod failed: Invalid argument

2016-01-28 Thread Rainer Blome
> Corinna Vinschen wrote 2016-01-28 18:22:
> On Jan 28 17:06, Rainer Blome wrote:
> > > Corinna Vinschen wrote 2016-01-28 15-44:
> > > On Jan 28 15:24, Rainer Blome wrote:
> > > the acl should always at least contain ACEs for the
> > > default POSIX perms, plus a NULL ACE:
> > > 
> > > foo NULL SID:(DENY)(Rc,S)
> > > VINSCHEN\corinna:(R,W,D,WDAC,WO)
> > > VINSCHEN\vinschen:(R)
> > > Everyone:(Rc,S,RA)
> > 
> > In Windows Explorer -> `bar` -> RMB -> Properties -> Security ->
> > Advanced, I am told that it inherits ist permissions from `base`,
> > the parent of `bar`. (To be precise, it inherits from its
> > grandparent, but I assume that the length of the ancestor chain is
> > not important here.)
> 
> This means the permission have been inherited when creating the
> file but Cygwin couldn't overwrite the ACL with a POSIXified variant
> for one reason or another.  It might have to do with this mysterious
> group 213...
> 
> > > For directories also inheritable default perms for "CREATOR OWNER" and
> > > "CREATOR GROUP".  Is that really a Cygwin mkdir?!?
> > 
> > As far as can see, yes, see above.
> > 
> > > And then, what about
> > > this unknwon group with gid 213?  What does
> > > 
> > >   $ getent group 213
> > > 
> > > print?  Something's weird here...
> > 
> > getent group 213; echo $?
> > 2
> 
> Ok, that's not exactly helpful to analyze this problem.  Can you try
> running another strace
> 
>   strace -o getfacl.trace getfacl 
> 
> on a file which has supposedly that group as owning group, e.g.  your
> "base" dir?  We might have a chance to look at the SID of group 213 in
> there.

That command segfaults, just as `strace : ` does.

> On a hunch, do you have old /etc/passwd and /etc/group files by any
> chance?  Does moving them out of /etc (don't delete them for now!),
> exiting from Cygwin and starting a new shell somehow fix things for you?
> How do the files look like?

Define "old"! ;-) Yes, I do. There is no `/etc/group`, but
`/etc/passwd` defines the group ID of my user as 213 (the real ID
is a bit different, to be honest, but I do not think that matters.)
When I rename the file and open a new Cygwin terminal, things start
to work. `strace echo` yields the expected output, `chmod` does
what it's supposed to do, and `git config`, `git init` and `git
clone foo foo2` work as well.

The `git clone repo:bar` then fails because my `~/.ssh` is
apparently no longer found (and I can only log in via SSH
key). This is a bit surprising, because in the new terminal,
`$HOME` and `~/.` are still set the way I specified it in the old
`/etc/passwd` (now with extension `.renamed`). So some programs
apparently use one method of determining the home directory, and
others use a different method. I will look into that tomorrow.

If, after this "breakthrough", there is still value in looking
further into the ACLs, I am willing to do that. However, the strace
output looks awfully laborious to sanitize, so I can not do this
today.

Thanks for the help so far.

Rainer

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



chmod failed: Invalid argument [was: git clone fails with: error: chmod on config.lock failed: Invalid argument]

2016-01-28 Thread Rainer Blome
Christopher Cobb wrote on Thu, 28 Jan 2016 01:27:16 +0100:
> Or maybe chmod is broken, like it is on my machine

You nailed it, thanks! Indeed, `chmod` appears to always fail,
on any file. Git tries to use it, and that fails.


cd
touch foo
ls -l foo
-rwx-- 1 myusername 213 0 Jan 28 14:22 foo

chmod u-w foo
chmod: changing permissions of ‘foo’: Invalid argument


Corinna and Ken, thanks for your suggestions too, replies below.

Rainer


= Details recorded before I understood the chmod problem:

First I created the directory manually and tried `git init`.


$ mkdir bar
$ cd bar

$ git init
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
Initialized empty Git repository in /cygdrive/c/base/bar/.git/


Looks as if the repository was created as expected:


$ ls -la .git
total 11
drwx--+ 1 myusername 213  0 Jan 28 13:15 .
drwx--+ 1 myusername 213  0 Jan 28 13:15 ..
-rwx--  1 myusername 213 36 Jan 28 13:15 config
-rwx--  1 myusername 213 73 Jan 28 13:15 description
-rwx--  1 myusername 213 23 Jan 28 13:15 HEAD
drwx--+ 1 myusername 213  0 Jan 28 13:15 hooks
drwx--+ 1 myusername 213  0 Jan 28 13:15 info
drwx--+ 1 myusername 213  0 Jan 28 13:15 objects
drwx--+ 1 myusername 213  0 Jan 28 13:15 refs

$ git fsck
notice: HEAD points to an unborn branch (master)
Checking object directories: 100% (256/256), done.
notice: No default references


The experiment with `git init` showns that Git can
create ordinary files and directories just fine.


The problem appears when Git tries to `chmod config.lock`. Sounds
like a mechanism to protect `.git/config`, so let's see what
happens if I try to use `git config` to modify that file:


git config user.email myusern...@xyz.org
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument


That narrows it down a bit. When modifying `.git/config`, Git
creates a temporary file `config.lock` and immediately tries to
do `chmod 0777 config.lock` (or any other permission set), which fails.


= On Jan 27 08:30, Ken Brown wrote:
> There might be a problem with the default ACL on the directory
> /cygdrive/c/base.

The directory is one of my usual base directories for git repos.
I have not knowingly changed any permissions or ACLs there.
The experiments with `git init` above show that the base dir is not
to blame, IMO.

I am logged in as my usual Windows user, unchanged in years.

 whoami
 myusername

> What does 'getfacl /cygdrive/c/base' show?


cd base

getfacl .
# file: .
# owner: myusername
# group: 213 
user::rwx
user:myusername:rwx
group::r-x
mask:rwx
other:r-x
default:user::rwx
default:user:myusername:rwx
default:group::r-x
default:mask:rwx
default:other:r-x


= Corinna Vinschen wrote on Wed, 27 Jan 2016 15:53:14 +0100:

> The setup of the ACL may give us a hint why git apparently
> fails to create the bar subdir.

I assume that Git did not fail to create the directory, it just
removed it again when the clone failed.

> what does the native windows icacls command print for that
> directory?


$ icacls .
. myhostname\myusername:(F)
  myhostname\None:(RX)
  Everyone:(RX)
  myhostname\myusername:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files


I assume that means that myusername has (F)ull control.

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



Re: chmod failed: Invalid argument

2016-01-28 Thread Rainer Blome
(Apologies for not using the reply feature, I was not
subscribed when the last mail was sent. I am now subscribed.)

> Corinna Vinschen wrote:
> On Jan 28 01:27, Christopher Cobb wrote:
>> Or maybe chmod is broken, like it is on my machine:
>> $ chmod 777 x
>> chmod: changing permissions of âxâ: Invalid argument

> Can you please send the icacls output of the current directory and
> the icacls out for the file x?

Here are the icacls outputs for the test case:

$ umask
0027

$ mkdir bar
$ cd bar
$ icacls .
. hostname\username:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files

$ touch foo
$ ls -la
total 0
drwx--+ 1 username 213 0 Jan 28 15:14 .
drwx--+ 1 username 213 0 Jan 28 15:14 ..
-rwx--  1 username 213 0 Jan 28 15:14 foo

$ icacls foo
foo hostname\username:(I)(F)

Successfully processed 1 files; Failed processing 0 files

$ icacls .
. hostname\username:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files

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



git clone fails with: error: chmod on config.lock failed: Invalid argument

2016-01-27 Thread Rainer Blome
Hi!

When I use "git clone foo bar" on a Linux host, it works as expected.

 git clone foo bar
 Cloning into 'bar'...
 done.

When I use the same command on my Cygwin 64 installation, this used
to work, but does not work any more.  I can fetch and otherwise use
Git in existing repos all right (have not noticed anything else
amiss), but the clone command fails like this:


cd /cygdrive/c/base
git clone foo bar
Cloning into 'bar'...
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
error: chmod on /cygdrive/c/base/bar/.git/config.lock failed: Invalid argument
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


Directory `bar` exists neither before nor after the attempted cloning.
In the parent directory, manually creating a subdirectory works as
expected:

 /cygdrive/c/base> mkdir bar; ls -ld bar; rmdir bar
 drwx--+ 1 username 123 0 Jan 27 13:13 bar

The issue is not restricted to local cloning, the same messages are
printed when I attempt to clone from a remote host (from which I
can clone just fine from a Linux client).

Searching the internet for "cygwin git error chmod on config.lock
failed: Invalid argument" gave not useful results.

I first noticed the issue after having upgraded to Cygwin 2.4.0-1.
Juding from the directory creation times in `base`,
it looks like the last successful clone happened on 2015-07-28.
I do not know which version of Cygwin I used at that time,
I update roughly once a month.

Today, I upgraded to 2.4.1-1, the issue persists.

I tried downgrading git from 2.7 to 2.6 via the installer.
The issue persisted, so I rolled forward again, the issue persisted.

How can I troubleshoot this further?

Rainer

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



Package emacs-x11 depends on package dbus-x11, but fails to declare this

2015-08-04 Thread Rainer Blome
Hi,

Package emacs-x11 depends on package dbus-x11 and should declare this,
but apparently does not.

Please change package emacs-x11 so that it declares its dependency on
paackage dbus-x11.

Details:
When doing a fresh install of Cygwin 64bit, I selected xlaunch,
emacs-x11 and a few other packages and let the dependency
satisfaction mechanism do its thing.
This resulted in a working X Server and XTerm, and
I could start emacs without X (option -nw).
However, trying to start Emacs for an Xterm without -nw
yields this output (and no Emacs window):

 emacs
 process 7588: D-Bus library appears to be incorrectly set up; failed to read 
machine uuid:\
  Failed to open /etc/machine-id: No such file or  directory
 See the manual page for dbus-uuidgen to correct this issue.
   D-Bus not compiled with backtrace support so unable to print a backtrace
 Fatal error 6: AbortedAborted (core dumped)

Trying this did not work because the program was missing:

 dbus-uuidgen  /etc/machine-id
 -bash: dbus-uuidgen: command not found

Installing package dbus-x11 helped, Emacs starts now. (Yay! :-)

Best Regards, Rainer

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



Re: Aw: Re: Xwin 1.17.2.1 exits early

2015-08-02 Thread Rainer Blome
Jon, thanks for the help.

On 29.07.2015 23:52, Jon TURNEY wrote:
 On 29/07/2015 18:49, Rainer Blome wrote:
 strace-XWin-multiwindow-RB.log
 Protection\12.1.4013.4013.105\Data\Definitions\BASHDefs\20150625.011\UMEngx86.dll
 at 6E5D

 This looks very much like an exception is occurring in sysfer.dll (which
 is part of 'Symantec Endpoint Protection'

Looks and sounds plausible.

 This has been reported as causing problems a few times recently (See
 [1],[2]).  If possible, you should try to update it or create an
 exception for XWin.exe

It updates automatically, not sure if I can create an exception.
I'll give that a try in the coming weeks. I already tried to temporarily
disable it, and that did not help.

 I think exception 0x8001 is STATUS_GUARD_PAGE_VIOLATION.  I'm not
 sure why this doesn't get translated into a non-zero exit code by Cygwin.
 
 [1] https://cygwin.com/ml/cygwin/2015-03/msg00080.html
 [2] https://cygwin.com/ml/cygwin/2015-05/msg00146.html

And thanks for the links.
From these I gather that the problem might disappear with a 64-bit
Cygwin installation.
I'll also try that.

Regards,  Rainer

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



Aw: Re: Xwin 1.17.2.1 exits early

2015-07-29 Thread Rainer Blome
 
Gesendet: Mittwoch, 29. Juli 2015 um 18:14 Uhr
Von: Jon TURNEY
 I think this is saying that using the start menu shortcuts doesn't work,
 but I'm not sure.

Yes, a few months ago, they stopped working for me.
For my report this is merely context, although I would appreciate it if they 
worked.

On 28/07/2015 16:43, Rainer Blome wrote:
 * I tried leaving out all command-line args but -multiwindow. Still no 
 success.

 How about leaving out all command-line args completely?

Same symptoms, exits after less than a second with same output (didn't diff, 
though).

 * I used the Cygwin installer to roll back to 1.17.1.5. Still no success.

 This tends to argue against that you were using 1.17.1-5 previously, or
 that other things e.g. the cygwin DLL were upgraded at the same time.

Yes, I may have come to 1.17.2 from a release earlier than 1.17.1-5

To be able to work, I installed VcXsrv which has 1.17.0.0 in its version 
string.
That mostly works fine, except that it refuses connections from remote 
SSH-X-forwarding clients
(did not try to troubleshoot that yet, it's just been a few hours).

 How can I troubleshoot this further?

 Can you provide the logfile written by 'strace -o logfile XWin -multiwindow' 
 which might shed some light.

Yes, attached.

Regards, Rainer
--- Process 7432 created
--- Process 7432 loaded C:\Windows\SysWOW64\ntdll.dll at 77D8
--- Process 7432 unloaded DLL at 77A8
--- Process 7432 unloaded DLL at 7692
--- Process 7432 unloaded DLL at 77A8
--- Process 7432 unloaded DLL at 7798
--- Process 7432 loaded C:\Windows\SysWOW64\kernel32.dll at 7692
--- Process 7432 loaded C:\Windows\SysWOW64\KernelBase.dll at 76AD
--- Process 7432 loaded C:\Windows\SysWOW64\sysfer.dll at 756C
--- Process 7432 loaded C:\ProgramData\Symantec\Symantec Endpoint Protection\12.1.4013.4013.105\Data\Definitions\BASHDefs\20150625.011\UMEngx86.dll at 6E5D
--- Process 7432 loaded C:\cygwin\bin\cygwin1.dll at 6100
--- Process 7432 loaded C:\cygwin\bin\cygxcb-icccm-4.dll at 5ED9
--- Process 7432 loaded C:\cygwin\bin\cygxcb-1.dll at 5EDC
--- Process 7432 loaded C:\cygwin\bin\cygXau-6.dll at 6A2B
--- Process 7432 loaded C:\cygwin\bin\cygXdmcp-6.dll at 6A20
--- Process 7432 loaded C:\cygwin\bin\cygxcb-image-0.dll at 5ED8
--- Process 7432 loaded C:\cygwin\bin\cygxcb-shm-0.dll at 5ED6
--- Process 7432 loaded C:\cygwin\bin\cygxcb-util-1.dll at 5ED5
--- Process 7432 loaded C:\cygwin\bin\cyggcc_s-1.dll at 6895
--- Process 7432 loaded C:\cygwin\bin\cygpixman-1-0.dll at 618C
--- Process 7432 loaded C:\cygwin\bin\cygX11-xcb-1.dll at 6A2C
--- Process 7432 loaded C:\cygwin\bin\cygX11-6.dll at 6A2D
--- Process 7432 loaded C:\cygwin\bin\cygXfixes-3.dll at 6A1D
--- Process 7432 loaded C:\cygwin\bin\cygXfont-1.dll at 6A19
--- Process 7432 loaded C:\cygwin\bin\cygbz2-1.dll at 697E
--- Process 7432 loaded C:\cygwin\bin\cygfontenc-1.dll at 68BA
--- Process 7432 loaded C:\cygwin\bin\cygz.dll at 5EB5
--- Process 7432 loaded C:\cygwin\bin\cygfreetype-6.dll at 689A
--- Process 7432 loaded C:\cygwin\bin\cygpng16-16.dll at 616D
--- Process 7432 loaded C:\Windows\SysWOW64\advapi32.dll at 75CA
--- Process 7432 loaded C:\Windows\SysWOW64\msvcrt.dll at 7687
--- Process 7432 loaded C:\Windows\SysWOW64\sechost.dll at 766A
--- Process 7432 loaded C:\Windows\SysWOW64\rpcrt4.dll at 7785
--- Process 7432 loaded C:\Windows\SysWOW64\sspicli.dll at 7589
--- Process 7432 loaded C:\Windows\SysWOW64\cryptbase.dll at 7588
--- Process 7432 loaded C:\Windows\SysWOW64\gdi32.dll at 76A4
--- Process 7432 loaded C:\Windows\SysWOW64\user32.dll at 7614
--- Process 7432 loaded C:\Windows\SysWOW64\lpk.dll at 7658
--- Process 7432 loaded C:\Windows\SysWOW64\usp10.dll at 75B7
--- Process 7432 loaded C:\Windows\SysWOW64\ole32.dll at 7671
--- Process 7432 loaded C:\Windows\SysWOW64\opengl32.dll at 5E24
--- Process 7432 loaded C:\Windows\SysWOW64\glu32.dll at 5E51
--- Process 7432 loaded C:\Windows\SysWOW64\ddraw.dll at 6BDB
--- Process 7432 loaded C:\Windows\SysWOW64\dciman32.dll at 6BDA
--- Process 7432 loaded C:\Windows\SysWOW64\setupapi.dll at 7624
--- Process 7432 loaded C:\Windows\SysWOW64\cfgmgr32.dll at 7780
--- Process 7432 loaded C:\Windows\SysWOW64\oleaut32.dll at 75C1
--- Process 7432 loaded C:\Windows\SysWOW64\devobj.dll at 7783
--- Process 7432 loaded C:\Windows\SysWOW64\dwmapi.dll at 74AA
--- Process 7432 loaded C:\Windows\SysWOW64\shell32.dll at 76B2
--- Process 7432 loaded C:\Windows\SysWOW64\shlwapi.dll at 758F
--- Process 7432 thread 7692 created
1   1 [main] XWin (7432) **
  239 240 [main] XWin (7432) Program name: C:\cygwin\bin\XWin.exe (windows pid 7432)
  145 385 [main] XWin (7432) OS version:   Windows NT-6.1
  201 586 [main] XWin (7432) **
  182

Xwin 1.17.2.1 exits early

2015-07-28 Thread Rainer Blome
First off: I have been using Cygwin for about 15 years now,
thanks to the maintainers!!!

For a few months now, the only way for me to get Cygwin/X to run
was to start a Cygwin terminal (C:\cygwin\bin\mintty.exe -i 
/Cygwin-Terminal.ico -),
then run XWin -multiwindow -clipboard from there, in the foreground.
That has worked for many weeks now.

Today, I upgraded from 1.17.1-5 to 1.17.2-1 (I think),
and XWin no longer starts as it used to.
No X icon appears, XWin exits almost immediately, with return code zero.

This is the output:

Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.17.2.0
OS: CYGWIN_NT-6.1-WOW  2.1.0(0.287/5/3) 2015-07-14 21:26 i686
OS: Windows 7 Service Pack 1 [Windows NT 6.1 build 7601] (WoW64)
Package: version 1.17.2-1 built 2015-07-09

XWin was started with the following command line:

Xwin -multiwindow

(II) xorg.conf is not supported
(II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
LoadPreferences: /cygdrive/c/blome/.XWinrc not found
LoadPreferences: Loading /etc/X11/system.XWinrc
LoadPreferences: Done parsing the configuration file...
winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL
winDetectSupportedEngines - Returning, supported engines 0005



* The machine is not loaded, has plenty of RAM and works fine otherwise.
* I used dash - /usr/bin/rebaseall -v, and
  feel stupid actually jumping through this particular type of hoop.
  Still no success.
* I rebooted MS Windows. Still no success.
* I disabled the firewall. Still no success.
* I tried leaving out all command-line args but -multiwindow. Still no 
success.
* I searched the internet for some of the messages,
  especially the xorg.conf is not supported one. Nothing appropriate.
* I read some of the FAQ (searched for xorg.conf in it). Nothing appropriate.
* I looked at the past two months of mailing list. Nothing appropriate.
* I used the Cygwin installer to roll back to 1.17.1.5. Still no success.

With Version 1.17.1-5, the package version differed, of course:

 Package: version 1.17.1-5 built 2015-06-02

and there were additional messages like this,
which may have ben caused by the downgrade:

 Could not load crashreporter dll

Other than that, the output was the same.

* I also tried the startxwin script, which not surprisingly,
  gives the above messages plus these:

 xinit: giving up
 xinit: unable to connect to X server: Connection refused
 xinit: server error

How can I troubleshoot this further?

Rainer

PS: My expectation is this:

In Cygwin installer, select newest package xorg.server, install,
accept suggested set of additional packages to install (dependencies),
opt to create shortcuts.
Start X11 server via the new shortcut,
an X icon appears in the system tray (lower right-hand corner).
Right-click the X icon, start X11 apps from there.
At some point a few years back (at least 2012), this actually worked.


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