Commit graph

8089 commits

Author SHA1 Message Date
Aaron 8bf19f7144 updates to CMakeFile.txt 2015-08-05 13:28:12 -07:00
Aaron 8e5bfe3072 updates to CMakeFile.txt 2015-08-05 13:28:12 -07:00
Peter Honeder c9cf2a42fa re-pin to latest cleanup 2015-08-05 15:50:36 +02:00
Peter Honeder b2c7331f7c re-pin to latest refactoring fixes 2015-08-05 15:44:54 +02:00
Andrew Schwartzmeyer 1d18a810ab Update pinned monad-native 2015-08-04 18:38:04 -07:00
Andrew Schwartzmeyer 2ec0c2996f Use WCHAR sizes instead of CHAR sizes
Such that lpnSize is the length (number of UTF-16 characters, including
null) of the username. Must be multiplied by sizeof(char16_t) for bytes.
2015-08-04 18:31:54 -07:00
Andrew Schwartzmeyer 447896aede Use WCHAR sizes instead of CHAR sizes
Such that lpnSize is the length (number of UTF-16 characters, including
null) of the username. Must be multiplied by sizeof(char16_t) for bytes.
2015-08-04 18:31:54 -07:00
Andrew Schwartzmeyer 90de5ae488
Change mshttps to https for Pester submodule
Should not assume mshttps anyway, plus it's been deprecated.
2015-08-04 16:38:12 -07:00
Zachary Folwick f24dfb02dc added Format-List test 2015-08-04 16:07:14 -07:00
Andrew Schwartzmeyer 2a6305ca11 Add passing GetUserName unit test
Updates monad-native submodule to include GetUserName P/Invoke, and
updates monad submodule to use said P/Invoke.

Matches the username against ^[a-z][a-z0-9\-]*$
2015-08-04 14:48:12 -07:00
Aaron 9ff9a88279 Made changes based off feedback from Peter. Also added more unit tests 2015-08-04 14:38:53 -07:00
Aaron 54618f1750 Made changes based off feedback from Peter. Also added more unit tests 2015-08-04 14:38:53 -07:00
Andrew Schwartzmeyer 7d007d6708 Remove PAL submodule 2015-08-04 14:16:57 -07:00
Andrew Schwartzmeyer e64c8961c9 Update GetUserName tests
Note that these fail when run in a Docker container because a) the
current container's locale is not completely set, and b) getlogin()
returns null with ENOENT since /var/run/utmp is being mapped to the
host, and thus denied access from within the container.

The container needs the locale set and its own /run/utmp, see
https://lists.linuxcontainers.org/pipermail/lxc-users/2011-July/002374.html
2015-08-04 14:16:57 -07:00
Andrew Schwartzmeyer b77b0a7e6c Update GetUserName tests
Note that these fail when run in a Docker container because a) the
current container's locale is not completely set, and b) getlogin()
returns null with ENOENT since /var/run/utmp is being mapped to the
host, and thus denied access from within the container.

The container needs the locale set and its own /run/utmp, see
https://lists.linuxcontainers.org/pipermail/lxc-users/2011-July/002374.html
2015-08-04 14:16:57 -07:00
Andrew Schwartzmeyer d60bfe0376 Use icu for Unicode conversion and fix lpnSize
A careful reading of the GetUserName documentation and Windows Data
Types says that lpnSize is "the number of TCHARs copied to the
buffer...including the terminating null character," and a TCHAR in this
environment is a CHAR because we assume UNICODE is always defined for
CoreCLR. A CHAR is a byte. So lpSize is number of bytes, not number of
UTF-16 characters as we previously believed.
2015-08-04 14:16:49 -07:00
Andrew Schwartzmeyer 052ecc801d Use icu for Unicode conversion and fix lpnSize
A careful reading of the GetUserName documentation and Windows Data
Types says that lpnSize is "the number of TCHARs copied to the
buffer...including the terminating null character," and a TCHAR in this
environment is a CHAR because we assume UNICODE is always defined for
CoreCLR. A CHAR is a byte. So lpSize is number of bytes, not number of
UTF-16 characters as we previously believed.
2015-08-04 14:16:49 -07:00
Andrew Schwartzmeyer 6ddb39e337 Link ps against icu instead of scxcore
Remove scxcore library from CMake
2015-08-04 14:14:07 -07:00
Andrew Schwartzmeyer 84d24589be Link ps against icu instead of scxcore
Remove scxcore library from CMake
2015-08-04 14:14:07 -07:00
Zachary Folwick f86f856ba6 undid failing test 2015-08-04 11:19:41 -07:00
Zachary Folwick df8722dfc8 created a failing test for jenkins troubleshooting 2015-08-04 10:57:54 -07:00
Zachary Folwick 1a38a52e00 added format-table tests 2015-08-04 00:31:30 -07:00
Aaron 245b287443 added more error handling 2015-08-03 13:54:07 -07:00
Aaron c979881804 added more error handling 2015-08-03 13:54:07 -07:00
Andrew Schwartzmeyer 0c9fb0d01b Rename userName in test to expectedUsername
To clarify that it is for comparison; not the result of GetUserName.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 011d8f41ea Rename userName in test to expectedUsername
To clarify that it is for comparison; not the result of GetUserName.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer b076850012 Refactor setting of lpnSize when buffer size is insufficient 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer d589ac1cbf Refactor setting of lpnSize when buffer size is insufficient 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 2a2c1d9236 Remove unnecessary static qualifier from const string 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 865fd0a56b Remove unnecessary static qualifier from const string 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 0592a37395 Use std::string instead of C99 dynamic array 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer b36cdcdc12 Use std::string instead of C99 dynamic array 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 9426e9c455 Use LOGIN_NAME_MAX instead of L_cuserid
Since L_cuserid is only for cuserid, not getlogin_r

Unit test for L_cuserid removed because the macro may not be available
on all platforms.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer bb8d0b793e Use LOGIN_NAME_MAX instead of L_cuserid
Since L_cuserid is only for cuserid, not getlogin_r

Unit test for L_cuserid removed because the macro may not be available
on all platforms.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer cbee353d0d Add more unit test coverage for GetUserName 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer e2d4ce0ab1 Add more unit test coverage for GetUserName 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 4a2c1c5a95 Set lpnSize when insufficient 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 876a88c7d8 Set lpnSize when insufficient 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 0f07a65f50 Use test fixture in GetUserName unit tests 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer edcb8b0402 Use test fixture in GetUserName unit tests 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer e8cb7e24fe Use L_cuserid instead of 64 and given lpnSize 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 59eb8a5799 Use L_cuserid instead of 64 and given lpnSize 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 3ab3408378 Factor out using directives 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 097d2e3821 Factor out using directives 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 6699091f7b Change global to local static const
To avoid polluting the global namespace without using a namespace.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 14cec68d08 Change global to local static const
To avoid polluting the global namespace without using a namespace.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 41a00d9279 Clarify lpBuffer layout in GetUserName unit test 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 80f8fff6f2 Clarify lpBuffer layout in GetUserName unit test 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 3ac74ab849 Convert get_login_r to UTF-16 and return 2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer 00390847e6 Convert get_login_r to UTF-16 and return 2015-08-03 13:00:34 -07:00