diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-06-10 15:33:12 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-06-10 15:33:12 +0000 |
commit | 8675d2e3010f6b2af7934d32868d417bb46ae2cb (patch) | |
tree | 1e02bd229755609c42d207103c7579eae68b2f49 /winsup/cygwin/sec_auth.cc | |
parent | e9c0122ec043e57f6c23577474c7afb1f8cad79b (diff) | |
download | cygnal-8675d2e3010f6b2af7934d32868d417bb46ae2cb.tar.gz cygnal-8675d2e3010f6b2af7934d32868d417bb46ae2cb.tar.bz2 cygnal-8675d2e3010f6b2af7934d32868d417bb46ae2cb.zip |
* sec_auth.cc (get_user_groups): Don't handle ERROR_ACCESS_DENIED as
error. Explain why.
Diffstat (limited to 'winsup/cygwin/sec_auth.cc')
-rw-r--r-- | winsup/cygwin/sec_auth.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index dd5ee0627..d6f3bb5d8 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -259,8 +259,14 @@ get_user_groups (WCHAR *logonserver, cygsidlist &grp_list, if (ret) { __seterrno_from_win_error (ret); - /* It's no error when the user name can't be found. */ - return ret == NERR_UserNotFound; + /* It's no error when the user name can't be found. + It's also no error if access has been denied. Yes, sounds weird, but + keep in mind that ERROR_ACCESS_DENIED means the current user has no + permission to access the AD user information. However, if we return + an error, Cygwin will call DsGetDcName with DS_FORCE_REDISCOVERY set + to ask for another server. This is not only time consuming, it's also + useless; the next server will return access denied again. */ + return ret == NERR_UserNotFound || ret == ERROR_ACCESS_DENIED; } len = wcslen (domain); |