Index: /trunk/src/VBox/HostServices/auth/directoryservice/directoryservice.cpp
===================================================================
--- /trunk/src/VBox/HostServices/auth/directoryservice/directoryservice.cpp	(revision 35942)
+++ /trunk/src/VBox/HostServices/auth/directoryservice/directoryservice.cpp	(revision 35943)
@@ -1,6 +1,5 @@
 /** @file
  *
- * VBox Remote Desktop Protocol:
- * External Authentication Library:
+ * VirtualBox External Authentication Library:
  * Mac OS X Authentication. This is based on
  * http://developer.apple.com/mac/library/samplecode/CryptNoMore/
@@ -8,5 +7,5 @@
 
 /*
- * Copyright (C) 2009-2010 Oracle Corporation
+ * Copyright (C) 2009-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -258,9 +257,12 @@
 
 RT_C_DECLS_BEGIN
-DECLEXPORT(AuthResult) AUTHCALL VRDPAuth(PAUTHUUID pUuid,
-                                         AuthGuestJudgement guestJudgement,
-                                         const char *pszUser,
-                                         const char *pszPassword,
-                                         const char *pszDomain)
+DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller,
+                                          PAUTHUUID pUuid,
+                                          AuthGuestJudgement guestJudgement,
+                                          const char *szUser,
+                                          const char *szPassword,
+                                          const char *szDomain,
+                                          int fLogon,
+                                          unsigned clientId)
 {
     /* Validate input */
@@ -270,4 +272,8 @@
     /* Result to a default value */
     AuthResult result = AuthResultAccessDenied;
+
+    /* Only process logon requests. */
+    if (!fLogon)
+        return result; /* Return value is ignored by the caller. */
 
     tDirStatus dsErr = eDSNoErr;
@@ -317,4 +323,4 @@
 RT_C_DECLS_END
 
-static PAUTHENTRY gpfnAuthEntry = VRDPAuth;
-
+static PAUTHENTRY3 gpfnAuthEntry = AuthEntry;
+
Index: /trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c
===================================================================
--- /trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c	(revision 35942)
+++ /trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c	(revision 35943)
@@ -1,11 +1,10 @@
 /** @file
  *
- * VBox Remote Desktop Protocol:
- * External Authentication Library:
+ * VirtualBox External Authentication Library:
  * Linux PAM Authentication.
  */
 
 /*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -29,9 +28,10 @@
  *
  * The Auth module takes the PAM service name from the
- * environment variable VRDP_AUTH_PAM_SERVICE. If the variable
+ * environment variable VBOX_AUTH_PAM_SERVICE. If the variable
  * is not specified, then the 'login' PAM service is used.
  */
-#define VRDP_AUTH_PAM_SERVICE_NAME_ENV "VRDP_AUTH_PAM_SERVICE"
-#define VRDP_AUTH_PAM_DEFAULT_SERVICE_NAME "login"
+#define VBOX_AUTH_PAM_SERVICE_NAME_ENV_OLD "VRDP_AUTH_PAM_SERVICE"
+#define VBOX_AUTH_PAM_SERVICE_NAME_ENV "VBOX_AUTH_PAM_SERVICE"
+#define VBOX_AUTH_PAM_DEFAULT_SERVICE_NAME "login"
 
 
@@ -39,11 +39,13 @@
  *
  * If defined, debug messages will be written to the file specified in the
- * VRDP_AUTH_DEBUG_FILENAME environment variable:
- *
- * export VRDP_AUTH_DEBUG_FILENAME=pam.log
+ * VBOX_AUTH_DEBUG_FILENAME (or deprecated VRDP_AUTH_DEBUG_FILENAME) environment
+ * variable:
+ *
+ * export VBOX_AUTH_DEBUG_FILENAME=pam.log
  *
  * The above will cause writing to the pam.log.
  */
-#define VRDP_AUTH_DEBUG_FILENAME_ENV "VRDP_AUTH_DEBUG_FILENAME"
+#define VBOX_AUTH_DEBUG_FILENAME_ENV_OLD "VRDP_AUTH_DEBUG_FILENAME"
+#define VBOX_AUTH_DEBUG_FILENAME_ENV "VBOX_AUTH_DEBUG_FILENAME"
 
 
@@ -54,15 +56,15 @@
  * and does not harm.
  */
-#define VRDP_PAM_DLLOAD
-
-
-#ifdef VRDP_PAM_DLLOAD
+#define VBOX_AUTH_USE_PAM_DLLOAD
+
+
+#ifdef VBOX_AUTH_USE_PAM_DLLOAD
 /* The name of the PAM library */
 # ifdef RT_OS_SOLARIS
-#  define VRDP_PAM_LIB "libpam.so.1"
+#  define PAM_LIB_NAME "libpam.so.1"
 # else
-#  define VRDP_PAM_LIB "libpam.so.0"
+#  define PAM_LIB_NAME "libpam.so.0"
 # endif
-#endif /* VRDP_PAM_DLLOAD */
+#endif /* VBOX_AUTH_USE_PAM_DLLOAD */
 
 
@@ -79,5 +81,5 @@
 #include <VBox/VBoxAuth.h>
 
-#ifdef VRDP_PAM_DLLOAD
+#ifdef VBOX_AUTH_USE_PAM_DLLOAD
 #include <dlfcn.h>
 
@@ -96,16 +98,27 @@
 #define fn_pam_end          pam_end
 #define fn_pam_strerror     pam_strerror
-#endif /* VRDP_PAM_DLLOAD */
+#endif /* VBOX_AUTH_USE_PAM_DLLOAD */
 
 static void debug_printf(const char *fmt, ...)
 {
-#ifdef VRDP_AUTH_DEBUG_FILENAME_ENV
+#if defined(VBOX_AUTH_DEBUG_FILENAME_ENV) || defined(VBOX_AUTH_DEBUG_FILENAME_ENV_OLD)
     va_list va;
 
     char buffer[1024];
 
-    const char *filename = getenv (VRDP_AUTH_DEBUG_FILENAME_ENV);
+    const char *filename = NULL;
 
     va_start(va, fmt);
+
+#if defined(VBOX_AUTH_DEBUG_FILENAME_ENV)
+    filename = getenv (VBOX_AUTH_DEBUG_FILENAME_ENV);
+#endif /* VBOX_AUTH_DEBUG_FILENAME_ENV */
+
+#if defined(VBOX_AUTH_DEBUG_FILENAME_ENV_OLD)
+    if (filename == NULL)
+    {
+        filename = getenv (VBOX_AUTH_DEBUG_FILENAME_ENV_OLD);
+    }
+#endif /* VBOX_AUTH_DEBUG_FILENAME_ENV_OLD */
 
     if (filename)
@@ -124,8 +137,8 @@
 
     va_end (va);
-#endif /* VRDP_AUTH_DEBUG_FILENAME_ENV */
-}
-
-#ifdef VRDP_PAM_DLLOAD
+#endif /* VBOX_AUTH_DEBUG_FILENAME_ENV || VBOX_AUTH_DEBUG_FILENAME_ENV_OLD */
+}
+
+#ifdef VBOX_AUTH_USE_PAM_DLLOAD
 
 static void *gpvLibPam = NULL;
@@ -151,9 +164,9 @@
     SymMap *iter;
 
-    gpvLibPam = dlopen(VRDP_PAM_LIB, RTLD_LAZY | RTLD_GLOBAL);
+    gpvLibPam = dlopen(PAM_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
 
     if (!gpvLibPam)
     {
-        debug_printf("auth_pam_init: dlopen %s failed\n", VRDP_PAM_LIB);
+        debug_printf("auth_pam_init: dlopen %s failed\n", PAM_LIB_NAME);
         return PAM_SYSTEM_ERR;
     }
@@ -203,13 +216,18 @@
     return;
 }
-#endif /* VRDP_PAM_DLLOAD */
+#endif /* VBOX_AUTH_USE_PAM_DLLOAD */
 
 static const char *auth_get_pam_service (void)
 {
-    const char *service = getenv (VRDP_AUTH_PAM_SERVICE_NAME_ENV);
+    const char *service = getenv (VBOX_AUTH_PAM_SERVICE_NAME_ENV);
 
     if (service == NULL)
     {
-        service = VRDP_AUTH_PAM_DEFAULT_SERVICE_NAME;
+        service = service = getenv (VBOX_AUTH_PAM_SERVICE_NAME_ENV_OLD);
+
+        if (service == NULL)
+        {
+            service = VBOX_AUTH_PAM_DEFAULT_SERVICE_NAME;
+        }
     }
 
@@ -285,14 +303,20 @@
 
 /* prototype to prevent gcc warning */
-DECLEXPORT(AuthResult) AUTHCALL VRDPAuth (PAUTHUUID pUuid,
+DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller,
+                                          PAUTHUUID pUuid,
                                           AuthGuestJudgement guestJudgement,
                                           const char *szUser,
                                           const char *szPassword,
-                                          const char *szDomain);
-DECLEXPORT(AuthResult) AUTHCALL VRDPAuth (PAUTHUUID pUuid,
+                                          const char *szDomain,
+                                          int fLogon,
+                                          unsigned clientId);
+DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller,
+                                          PAUTHUUID pUuid,
                                           AuthGuestJudgement guestJudgement,
                                           const char *szUser,
                                           const char *szPassword,
-                                          const char *szDomain)
+                                          const char *szDomain,
+                                          int fLogon,
+                                          unsigned clientId)
 {
     AuthResult result = AuthResultAccessDenied;
@@ -304,4 +328,8 @@
 
     pam_handle_t *pam_handle = NULL;
+
+    /* Only process logon requests. */
+    if (!fLogon)
+        return result; /* Return value is ignored by the caller. */
 
     debug_printf("u[%s], d[%s], p[%d]\n", szUser, szDomain, szPassword? strlen (szPassword): 0);
@@ -376,3 +404,3 @@
 
 /* Verify the function prototype. */
-static PAUTHENTRY gpfnAuthEntry = VRDPAuth;
+static PAUTHENTRY3 gpfnAuthEntry = AuthEntry;
Index: /trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp
===================================================================
--- /trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp	(revision 35942)
+++ /trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp	(revision 35943)
@@ -1,11 +1,10 @@
 /** @file
  *
- * VBox Remote Desktop Protocol:
- * External Authentication Library:
+ * VirtualBox External Authentication Library:
  * Simple Authentication.
  */
 
 /*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
Index: /trunk/src/VBox/HostServices/auth/winlogon/winlogon.cpp
===================================================================
--- /trunk/src/VBox/HostServices/auth/winlogon/winlogon.cpp	(revision 35942)
+++ /trunk/src/VBox/HostServices/auth/winlogon/winlogon.cpp	(revision 35943)
@@ -1,11 +1,10 @@
 /** @file
  *
- * VBox Remote Desktop Protocol:
- * External Authentication Library:
+ * VirtualBox External Authentication Library:
  * Windows Logon Authentication.
  */
 
 /*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
