Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-08-31 23:33:19 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-08-31 23:33:19 +0400
commitf2b03c9258bb9b7dbcb92d573e2b877d4c6f07dd (patch)
treebb42132ecb1c4cbd090a816d4b74389fd425172a /winsup/cygwin/uinfo.cc
parentf3b0b4cb513ee3c33a7694cfa56b060f11fafca6 (diff)
* uinfo.cc (pwdgrp::fetch_account_from_windows): Disallow user accounts
as groups. Add comment.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 4dff53ade..6d1b5b7a8 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -1504,6 +1504,13 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
switch (acc_type)
{
case SidTypeUser:
+ /* Don't allow users as group. While this is technically possible,
+ it doesn't make sense in a POSIX scenario. It *is* used for
+ Microsoft Accounts, but those are converted to well-known groups
+ above. */
+ if (is_group ())
+ return NULL;
+ /*FALLTHRU*/
case SidTypeGroup:
case SidTypeAlias:
/* Predefined alias? */