- drop always available Windows definitions
- add definitions missing from winternl.h
- make locale aware
- drop wchar<->char conversions and print wchar strings directly
- simplify flag printing
- print hex values with leading 0x and leading zeros
- add printing of flags from FILE_FS_SECTOR_SIZE_INFORMATION
Takashi Yano [Sat, 16 Jun 2018 10:13:52 +0000 (19:13 +0900)]
Fix the test of whether the computer is on a domain.
* cygwin-service-installation-helper.sh (csih_select_rivileged_username):
In the case logged in as a local user, csih failed to judge to be
on a domain even if the computer is on a domain. This is because
${LOGSERVER,,*} has the same value as \\\\${COMPUTERNAME,,*}. The
fix is done to use cygwin username returned by mkpasswd command to
check it instead. Also, testing has been changed so that USERDOMAIN
is used instead of LOGONSERVER because LOGONSERVER may not be set
if "Run as administrator" is used.
See the post below for more detail.
https://cygwin.com/ml/cygwin/2018-06/msg00166.html
Shaddy Baddah [Wed, 18 Jan 2017 03:34:04 +0000 (14:34 +1100)]
ssh-host-config: patch fix debug option + broken for me on Vista (non-domain)
Hi,
First please find attached a simple patch that fixes a problem I
encountered running ssh-host-config with the --debug option.
Pretty simple. Without redirecting the output of csih_stacktrace() to
stderr, then (3.5.4) Command Substitution of functions that call it will
run into problems. And the one that I encountered was this one:
cygwin-service-installation-helper.sh:1147:csih_mktemp ()
cygwin-service-installation-helper.sh:1148:{
cygwin-service-installation-helper.sh:1149: csih_stacktrace "${@}"
cygwin-service-installation-helper.sh:1150: $_csih_trace
cygwin-service-installation-helper.sh:1152: local __umask=$(umask)
cygwin-service-installation-helper.sh:1153: local rval
cygwin-service-installation-helper.sh:1154: local tmpdir
cygwin-service-installation-helper.sh:1156: tmpdir=$(csih_writable_tmpdir) ||
return 1
cygwin-service-installation-helper.sh:1158: umask 0077
cygwin-service-installation-helper.sh:1159: /usr/bin/mktemp
--tmpdir="${tmpdir}" "$@"
tmpdir will be filled with stacktrace output from the
csih_writable_tmpdir() call, and mktemp will fail.
Achim Gratz [Fri, 11 Mar 2016 19:43:33 +0000 (20:43 +0100)]
Fix creation of privileged user in /etc/passwd
* cygwin-service-installation-helper.sh (csih_create_privileged_user):
The user name for the priviledged user is in
${csih_PRIVILEGED_USERNAME} in this function, so use this variable
instead of ${username}.
Reported and fix suggested by Nick Battle in
https://cygwin.com/ml/cygwin/2016-03/msg00154.html
Group Permissions on root folders problem (Windows 10 TP build 10061)
Hi Corinna,
On Fri, 11 Sep 2015 13:10:12 +0200
Corinna Vinschen wrote:
> In theory, yes. The problem is just that checking the uid/gid equality
> is not safe, given that you can easily create that via passwd/group
> files. What I was thinking of is to convert the uid/gid values into
> SIDs using the `getent' tool and to compare those, along the lines of
>
> uid=$(/usr/bin/stat -c '%u')
> user_sid=$(getent passwd -w $uid | awk -F: '{print $4}')
> gid=$(/usr/bin/stat -c '%g')
> grp_sid=$(getent group -w $gid | awk -F: '{print $4}')
> if [ "${user_sid}" = "${grp_sid}" ]
> ...
>
> Can you check if that works in your env and perhaps create a new patch
> using the SIDs?
I have made a new patch and confirmed that it also works.
Corinna Vinschen [Sun, 30 Aug 2015 19:52:57 +0000 (19:52 +0000)]
* cygwin-service-installation-helper.sh: Throughout replace *server1014
with *server1016.
* native/winProductName.c (products): Add missing values since W10.
(GetOSDisplayString): Rename Server 2014 to Server 2016.
Achim Gratz [Mon, 23 Feb 2015 19:17:05 +0000 (19:17 +0000)]
Summary: correct the return value in the case that /etc/nsswitch.conf exists, but has no active line for that file
* cygwin-service-installation-helper.sh (csih_use_file_etc):
Correct the return value in the case that /etc/nsswitch.conf
exists, but has no active line for that file. The default
contains db, so use_file=1 must be maintained. Add a comment for
that case.
Achim Gratz [Fri, 20 Feb 2015 08:50:55 +0000 (08:50 +0000)]
* cygwin-service-installation-helper.sh
(csih_get_system_and_admins_ids): Remove reference to
/etc/{passwd/group} files.
(csih_check_passwd_and_group): Branch code based on the result of
csih_old_cygwin. Correct comment about the version that change
happened in Cygwin.
(csih_old_cygwin): Factor out check for Cygwin version that do not
have DB-based user/group lookup. Correct version that code
actually went into Cygwin.
(csih_use_file_etc): Use csih_old_cygwin. Correct the check for
nsswitch.conf content so that it confroms to the intended and
commented behaviour.
* cygwin-service-installation-helper.sh: Whitespace cleanup (only
trailing spaces, consider tabification). Register new function
"csih_old_cygwin".
* cygwin-service-installation-helper.sh (csih_privileged_accounts):
Fix copy/paste bug.
(csih_create_privileged_user): Evaluate local Windows administrators
group name instead of relying on Cygwin group name. Fix error message.
* version.h (VERSION_MICRO): Bump to 9.
Corinna Vinschen [Wed, 10 Dec 2014 19:11:58 +0000 (19:11 +0000)]
* Makefile: Remove stray trailing backslash.
* winProductName.c (GetOSDisplayString): Always call GetNativeSystemInfo
since we're only supporting XP and later anyway. Drop checks for
older OS-versions. Rearrange Major/Minor OS number check to accommodate
the menacing OS version 10.x for Windows 10.
Corinna Vinschen [Mon, 10 Nov 2014 17:17:40 +0000 (17:17 +0000)]
* native/Makefile (LIBS): Add default-manifest file.
(NTDLL): Define.
(getAccountName): Add $(CFLAGS). Fix usage of $(LIBS) for
PE/COFF platform.
(winProductName): Ditto. Add $(NTDLL).
* native/winProductName.c: Re-indent for better readability. Remove
not working tchar.h overhead.
(products): Drop "note"-type comments.
(RtlGetVersion): Declare.
(RtlGetProductInfo): Declare.
(GetOSDisplayString): Use RtlGetVersion and RtlGetProductInfo. Explain
why. Use switch statements rather than if/else if chains where
applicable. Add support for Windows 8.1, Server 2012 R2, Windows 10 and
Server 2014(?). Drop support for Windows versions prior to Windows XP.