From e4f48af0fd02a9e87f6ebcff10ab9d5f1d3556dc Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 12 Mar 2014 15:46:07 +0000 Subject: [PATCH] * uinfo.cc (pwdgrp::fetch_account_from_windows): Avoid crash on non-domain member machines if an unknown SID comes in. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/uinfo.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1369977c1..65c7328e7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-03-12 Corinna Vinschen + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Avoid crash on + non-domain member machines if an unknown SID comes in. + 2014-03-12 Corinna Vinschen * include/cygwin/socket.h (IPV6_JOIN_GROUP): Revert. diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index d1304ebff..10d335644 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -1752,7 +1752,8 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap) } else { - if (sid_id_auth (sid) == 5 /* SECURITY_NT_AUTHORITY */ + if (cygheap->dom.member_machine () + && sid_id_auth (sid) == 5 /* SECURITY_NT_AUTHORITY */ && sid_sub_auth (sid, 0) == SECURITY_NT_NON_UNIQUE) { /* Check if we know the domain. If so, create a passwd/group