summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/sec_helper.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index a1d8cba05..373b1df02 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -169,10 +169,16 @@ cygpsid::get_id (BOOL search_grp, int *type, cyg_ldap *pldap)
}
else if ((pw = internal_getpwsid (*this, pldap)))
id = pw->pw_uid;
- if (id != ILLEGAL_UID && type)
- *type = USER;
+ if (id != ILLEGAL_UID)
+ {
+ if (type)
+ *type = USER;
+ return id;
+ }
}
- return id;
+ if (type)
+ *type = 0; /* undefined type */
+ return ILLEGAL_UID;
}
PWCHAR