cygwin_conv_ functions and character encoding

2016-02-05 Thread Thomas Wolff

The cygwin path conversion functions ignore the current locale;
rather they seem to always use the locale environment set when the 
program was started, see test program convloc.c:


#include 
#include 
#include 
#include 
int main() {
  setlocale(LC_ALL, "C.UTF-8");
  char * utfstring = "böh";
  printf("ustring <%s>\n", utfstring);
  wchar_t * wstring = cygwin_create_path(CCP_POSIX_TO_WIN_W, utfstring);
  printf("wstring <%ls>\n", wstring);
}

Run in a UTF-8 terminal:
> LC_CTYPE=de_DE ./convloc
ustring (C.UTF-8) 
wstring (C.UTF-8) 

In sys_wcstombs in strfuncs.cc I see:
  const char *charset = cygheap->locale.charset;
which is set in internal_setlocale ()...

In fact, the situation can be fixed by adding after setlocale():
  cygwin_internal(CW_INT_SETLOCALE);  // -> internal_setlocale();
(cf. https://sourceware.org/ml/cygwin-developers/2010-02/msg00054.html)
but I think those functions should use the proper locale implicitly; 
according to the generic description in 
http://linux.die.net/man/3/setlocale,
LC_CTYPE affects ... conversion ... functions, in my opinion this would 
include cygwin-specific conversion functions as well as implicitly 
called conversion (see open() below).

The same problem applies to the open() function (involving path conversion).
The wide string function mbstowcs behaves as expected.


The whole issue occurred to me while trying to work around a missing 
conversion functionality, just converting the pathname syntax between 
Unicode strings. The desired options would be like:
  CCP_POSIX_W_TO_WIN_W,   /* from is wchar_t *posix, to is wchar_t 
*win32  */
  CCP_WIN_W_TO_POSIX_W,   /* from is wchar_t *win32, to is wchar_t 
*posix  */


--
Thomas

--
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: Tmux man page not up to date

2016-02-05 Thread Michael Wild
On Tue, Feb 2, 2016 at 4:54 PM Byron Boulton  wrote:
>
> The man page for tmux in Cygwin is not up to date. The version of tmux
> in cygwin is 2.1, but the man page is not consistent with that.
>
> Specifically I noticed it because I was getting warnings about my mouse
> configurations settings. There was a breaking change to this for tmux
> 2.1 as noted in the tmux changelog on their website.
>
> Byron Boulton
>

Hi Byron

I noticed that too when I packaged tmux-2.1, however it is the file
that is included in the tarball, and even in the repository it has
still not been updated:
https://github.com/tmux/tmux/blob/master/tmux.1

Kind regards

Michael

--
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: Tmux man page not up to date

2016-02-05 Thread Byron Boulton

On 2/5/2016 3:01 PM, Michael Wild wrote:

On Tue, Feb 2, 2016 at 4:54 PM Byron Boulton  wrote:


The man page for tmux in Cygwin is not up to date. The version of tmux
in cygwin is 2.1, but the man page is not consistent with that.

Specifically I noticed it because I was getting warnings about my mouse
configurations settings. There was a breaking change to this for tmux
2.1 as noted in the tmux changelog on their website.

Byron Boulton



Hi Byron

I noticed that too when I packaged tmux-2.1, however it is the file
that is included in the tarball, and even in the repository it has
still not been updated:
https://github.com/tmux/tmux/blob/master/tmux.1

Kind regards

Michael

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


That's very strange. I'll open an issue on github then.

Byron


--
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: Tmux man page not up to date

2016-02-05 Thread Byron Boulton

On 2/5/2016 3:31 PM, Byron Boulton wrote:

On 2/5/2016 3:01 PM, Michael Wild wrote:

On Tue, Feb 2, 2016 at 4:54 PM Byron Boulton  wrote:


The man page for tmux in Cygwin is not up to date. The version of tmux
in cygwin is 2.1, but the man page is not consistent with that.

Specifically I noticed it because I was getting warnings about my mouse
configurations settings. There was a breaking change to this for tmux
2.1 as noted in the tmux changelog on their website.

Byron Boulton



Hi Byron

I noticed that too when I packaged tmux-2.1, however it is the file
that is included in the tarball, and even in the repository it has
still not been updated:
https://github.com/tmux/tmux/blob/master/tmux.1

Kind regards

Michael

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


That's very strange. I'll open an issue on github then.

Byron


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


Wait. No it looks like it's up to date on the github page.

https://github.com/tmux/tmux/blob/master/tmux.1 has

.It Xo Ic mouse
.Op Ic on | off

Which is up to date. I also cloned the repo and the 2.1 tag has the 
mouse on/off settings documented rather than mouse-resize-pane etc.


So we should just need to checkout the 2.1 tag of the tmux repository, 
and the man page should be up to date.


Byron


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



Unknown+user issues using cygwin under an Azure AD "domain" account on Windows 10.1511?

2016-02-05 Thread Russell Mora
Hi All,

Big fan - long time user, first time mailer! :-)

Quick check - I'm seeing Unknown+user issues even since I started
logging in via an Azure AD "domain" account - I put "domain" in quotes
because Azure AD is not full AD domain services, just the identity
services (likely cause of my failure)

Anyway, this is what I see:

==
C:\WINDOWS\system32>whoami
azuread\russellmora

C:\WINDOWS\system32>
==

I used the 2.873 64-bit installer and did a basic install. When I
first fire up cygwin (from c:\cygwin64\cygwin.bat) I see this (note
the home dir and whoami are different, plus what to me seems like
unusual permissions for my home dir):

==
Copying skeleton files.
These files are for the users to personalise their cygwin experience.

They will never be overwritten nor automatically updated.

'./.bashrc' -> '/home/RussellMora//.bashrc'
/usr/bin/install: cannot create regular file
'/home/RussellMora//.bashrc': Permission denied
'./.bash_profile' -> '/home/RussellMora//.bash_profile'
/usr/bin/install: cannot create regular file
'/home/RussellMora//.bash_profile': Permission denied
'./.inputrc' -> '/home/RussellMora//.inputrc'
/usr/bin/install: cannot create regular file
'/home/RussellMora//.inputrc': Permission denied
'./.profile' -> '/home/RussellMora//.profile'
/usr/bin/install: cannot create regular file
'/home/RussellMora//.profile': Permission denied

Unknown+User@Lenovo-PC ~
$ whoami
Unknown+User

Unknown+User@Lenovo-PC ~
$ pwd
/home/RussellMora

Unknown+User@Lenovo-PC ~
$ ls -la
total 0
d--r-x+ 1 Unknown+User Unknown+Group 0 Feb  5 16:49 .
drwxrwxrwt+ 1 Unknown+User Unknown+Group 0 Feb  5 16:49 ..

Unknown+User@Lenovo-PC ~
$ uname -a
CYGWIN_NT-10.0 Lenovo-PC 2.4.1(0.293/5/3) 2016-01-24 11:26 x86_64 Cygwin

==

This all started because I was getting the "Failed to fork child
process: No such file or directory." issue when starting cygwin from
the start menu.  I did a clean install with clean registry but that
didn't help.

Any ideas?

Cheers,
Russell

--
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: Unknown+user issues using cygwin under an Azure AD "domain" account on Windows 10.1511?

2016-02-05 Thread Russell Mora
Finally occurred to me to run whoami under strace - I saw this which
was of interest:


 2706   10005 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
Unknown domain AzureAD
--- Process 13636 loaded C:\Windows\System32\netapi32.dll at 7FFAD6B5
--- Process 13636 loaded C:\Windows\System32\samcli.dll at 7FFACDD4
--- Process 13636 loaded C:\Windows\System32\samlib.dll at 7FFAD3D5
 2790   12795 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
--- Process 13636 loaded C:\Windows\System32\netutils.dll at 7FFAD528
 1086   13881 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   49   13930 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   27   13957 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   25   13982 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   23   14005 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   22   14027 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   25   14052 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 

   24   14076 [main] whoami 13636 pwdgrp::fetch_account_from_windows:
line: 
   26   14102 [main] whoami 13636 internal_getlogin: user not found in passwd DB
   22   14124 [main] whoami 13636 cygheap_user::ontherange: what 2, pw 0x0
   23   14147 [main] whoami 13636 cygheap_user::ontherange: HOME is
already in the environment /home/RussellMora


Went back to the Windows version of whoami and got this:


C:\WINDOWS\system32>whoami /fqdn
ERROR: Unable to get Fully Qualified Distinguished Name (FQDN) as the current
   logged-on user is not a domain user.

C:\WINDOWS\system32>


Yeah... I'm not too surprised it doesn't work

Cheers,
Russell.

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