Fix specific admin/user disconnect/logout codes

There seems to have been confusion with regards to which exit code and
message was returned by rdesktop for the following cases:

* disconnected by admin
* logged out by admin
* disconnect by user
* logoff by user

Looking at Microsoft's official documentation as well as testing using
Windows Server 2008 R2, 2012 R2 and 2016 reveals that this commit fixes
this issue. They do now match the reasons sent by the server.
This commit is contained in:
Samuel Mannehed 2017-10-04 09:38:56 +02:00
parent a6a2120cf7
commit 3aca74880a
2 changed files with 12 additions and 12 deletions

View File

@ -275,13 +275,13 @@ handle_disconnect_reason(RD_BOOL deactivated, uint16 reason)
break;
case ERRINFO_RPC_INITIATED_DISCONNECT:
text = "Server initiated disconnect";
retval = EXRD_API_DISCONNECT;
text = "Administrator initiated disconnect";
retval = EXRD_DISCONNECT_BY_ADMIN;
break;
case ERRINFO_RPC_INITIATED_LOGOFF:
text = "Server initiated logoff";
retval = EXRD_API_LOGOFF;
text = "Administrator initiated logout";
retval = EXRD_LOGOFF_BY_ADMIN;
break;
case ERRINFO_IDLE_TIMEOUT:
@ -325,13 +325,13 @@ handle_disconnect_reason(RD_BOOL deactivated, uint16 reason)
break;
case ERRINFO_RPC_INITIATED_DISCONNECT_BYUSER:
text = "Disconnect initiated by administration tool";
retval = EXRD_RPC_DISCONNECT_BY_USER;
text = "Disconnect initiated by user";
retval = EXRD_DISCONNECT_BY_USER;
break;
case ERRINFO_LOGOFF_BYUSER:
text = "Disconnect initiated by user";
retval = EXRD_DISCONNECT_BY_USER;
text = "Logout initiated by user";
retval = EXRD_LOGOFF_BY_USER;
break;
case ERRINFO_LICENSE_INTERNAL:

View File

@ -92,8 +92,8 @@
#endif
/* rdesktop specific exit codes, lined up with disconnect PDU reasons */
#define EXRD_API_DISCONNECT 1
#define EXRD_API_LOGOFF 2
#define EXRD_DISCONNECT_BY_ADMIN 1
#define EXRD_LOGOFF_BY_ADMIN 2
#define EXRD_IDLE_TIMEOUT 3
#define EXRD_LOGON_TIMEOUT 4
#define EXRD_REPLACED 5
@ -102,8 +102,8 @@
#define EXRD_DENIED_FIPS 8
#define EXRD_INSUFFICIENT_PRIVILEGES 9
#define EXRD_FRESH_CREDENTIALS_REQUIRED 10
#define EXRD_RPC_DISCONNECT_BY_USER 11
#define EXRD_DISCONNECT_BY_USER 12
#define EXRD_DISCONNECT_BY_USER 11
#define EXRD_LOGOFF_BY_USER 12
#define EXRD_LIC_INTERNAL 16
#define EXRD_LIC_NOSERVER 17
#define EXRD_LIC_NOLICENSE 18