summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/uinfo.cc19
2 files changed, 15 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9c2eb98c5..b959d74d3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix gid evaluation
+ for local accounts.
+
2014-04-10 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 30.
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 3b42754ed..a7a0fdfc3 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -1475,13 +1475,13 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
if (uid == ILLEGAL_UID)
uid = posix_offset + sid_sub_auth_rid (sid);
- if (is_domain_account)
- {
- /* We only care for the extended user information if we're
- creating a passwd entry and the account is, in fact, a user. */
- if (is_group () || acc_type != SidTypeUser)
- break;
+ /* We only care for extended user information if we're creating a
+ passwd entry and the account is a user or alias. */
+ if (is_group () || acc_type == SidTypeGroup)
+ break;
+ if (acc_type == SidTypeUser)
+ {
/* Default primary group. If the sid is the current user, fetch
the default group from the current user token, otherwise make
the educated guess that the user is in group "Domain Users"
@@ -1491,7 +1491,10 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
+ sid_sub_auth_rid (cygheap->user.groups.pgsid);
else
gid = posix_offset + DOMAIN_GROUP_RID_USERS;
+ }
+ if (is_domain_account)
+ {
/* Use LDAP to fetch domain account infos. */
if (!cldap->open (NULL))
break;
@@ -1561,7 +1564,7 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
/* Set comment variable for below attribute loop. */
comment = ui->usri4_comment;
}
- else if (acc_type == SidTypeAlias)
+ else /* acc_type == SidTypeAlias */
{
nas = NetLocalGroupGetInfo (NULL, name, 1, (PBYTE *) &gi);
if (nas != NERR_Success)
@@ -1572,8 +1575,6 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
/* Set comment variable for below attribute loop. */
comment = gi->lgrpi1_comment;
}
- else /* SidTypeGroup. No way to add a comment to "None" :( */
- break;
/* Local SAM accounts have only a handful attributes
available to home users. Therefore, fetch additional
passwd/group attributes from the "Description" field