Changeset 35943 in vbox for trunk/src/VBox/HostServices/auth
- Timestamp:
- Feb 11, 2011 1:04:47 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69996
- Location:
- trunk/src/VBox/HostServices/auth
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/auth/directoryservice/directoryservice.cpp
r34563 r35943 1 1 /** @file 2 2 * 3 * VBox Remote Desktop Protocol: 4 * External Authentication Library: 3 * VirtualBox External Authentication Library: 5 4 * Mac OS X Authentication. This is based on 6 5 * http://developer.apple.com/mac/library/samplecode/CryptNoMore/ … … 8 7 9 8 /* 10 * Copyright (C) 2009-201 0Oracle Corporation9 * Copyright (C) 2009-2011 Oracle Corporation 11 10 * 12 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 258 257 259 258 RT_C_DECLS_BEGIN 260 DECLEXPORT(AuthResult) AUTHCALL VRDPAuth(PAUTHUUID pUuid, 261 AuthGuestJudgement guestJudgement, 262 const char *pszUser, 263 const char *pszPassword, 264 const char *pszDomain) 259 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller, 260 PAUTHUUID pUuid, 261 AuthGuestJudgement guestJudgement, 262 const char *szUser, 263 const char *szPassword, 264 const char *szDomain, 265 int fLogon, 266 unsigned clientId) 265 267 { 266 268 /* Validate input */ … … 270 272 /* Result to a default value */ 271 273 AuthResult result = AuthResultAccessDenied; 274 275 /* Only process logon requests. */ 276 if (!fLogon) 277 return result; /* Return value is ignored by the caller. */ 272 278 273 279 tDirStatus dsErr = eDSNoErr; … … 317 323 RT_C_DECLS_END 318 324 319 static PAUTHENTRY gpfnAuthEntry = VRDPAuth;320 325 static PAUTHENTRY3 gpfnAuthEntry = AuthEntry; 326 -
trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c
r34563 r35943 1 1 /** @file 2 2 * 3 * VBox Remote Desktop Protocol: 4 * External Authentication Library: 3 * VirtualBox External Authentication Library: 5 4 * Linux PAM Authentication. 6 5 */ 7 6 8 7 /* 9 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 10 9 * 11 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 29 28 * 30 29 * The Auth module takes the PAM service name from the 31 * environment variable V RDP_AUTH_PAM_SERVICE. If the variable30 * environment variable VBOX_AUTH_PAM_SERVICE. If the variable 32 31 * is not specified, then the 'login' PAM service is used. 33 32 */ 34 #define VRDP_AUTH_PAM_SERVICE_NAME_ENV "VRDP_AUTH_PAM_SERVICE" 35 #define VRDP_AUTH_PAM_DEFAULT_SERVICE_NAME "login" 33 #define VBOX_AUTH_PAM_SERVICE_NAME_ENV_OLD "VRDP_AUTH_PAM_SERVICE" 34 #define VBOX_AUTH_PAM_SERVICE_NAME_ENV "VBOX_AUTH_PAM_SERVICE" 35 #define VBOX_AUTH_PAM_DEFAULT_SERVICE_NAME "login" 36 36 37 37 … … 39 39 * 40 40 * If defined, debug messages will be written to the file specified in the 41 * VRDP_AUTH_DEBUG_FILENAME environment variable: 42 * 43 * export VRDP_AUTH_DEBUG_FILENAME=pam.log 41 * VBOX_AUTH_DEBUG_FILENAME (or deprecated VRDP_AUTH_DEBUG_FILENAME) environment 42 * variable: 43 * 44 * export VBOX_AUTH_DEBUG_FILENAME=pam.log 44 45 * 45 46 * The above will cause writing to the pam.log. 46 47 */ 47 #define VRDP_AUTH_DEBUG_FILENAME_ENV "VRDP_AUTH_DEBUG_FILENAME" 48 #define VBOX_AUTH_DEBUG_FILENAME_ENV_OLD "VRDP_AUTH_DEBUG_FILENAME" 49 #define VBOX_AUTH_DEBUG_FILENAME_ENV "VBOX_AUTH_DEBUG_FILENAME" 48 50 49 51 … … 54 56 * and does not harm. 55 57 */ 56 #define V RDP_PAM_DLLOAD57 58 59 #ifdef V RDP_PAM_DLLOAD58 #define VBOX_AUTH_USE_PAM_DLLOAD 59 60 61 #ifdef VBOX_AUTH_USE_PAM_DLLOAD 60 62 /* The name of the PAM library */ 61 63 # ifdef RT_OS_SOLARIS 62 # define VRDP_PAM_LIB"libpam.so.1"64 # define PAM_LIB_NAME "libpam.so.1" 63 65 # else 64 # define VRDP_PAM_LIB"libpam.so.0"66 # define PAM_LIB_NAME "libpam.so.0" 65 67 # endif 66 #endif /* V RDP_PAM_DLLOAD */68 #endif /* VBOX_AUTH_USE_PAM_DLLOAD */ 67 69 68 70 … … 79 81 #include <VBox/VBoxAuth.h> 80 82 81 #ifdef V RDP_PAM_DLLOAD83 #ifdef VBOX_AUTH_USE_PAM_DLLOAD 82 84 #include <dlfcn.h> 83 85 … … 96 98 #define fn_pam_end pam_end 97 99 #define fn_pam_strerror pam_strerror 98 #endif /* V RDP_PAM_DLLOAD */100 #endif /* VBOX_AUTH_USE_PAM_DLLOAD */ 99 101 100 102 static void debug_printf(const char *fmt, ...) 101 103 { 102 #if def VRDP_AUTH_DEBUG_FILENAME_ENV104 #if defined(VBOX_AUTH_DEBUG_FILENAME_ENV) || defined(VBOX_AUTH_DEBUG_FILENAME_ENV_OLD) 103 105 va_list va; 104 106 105 107 char buffer[1024]; 106 108 107 const char *filename = getenv (VRDP_AUTH_DEBUG_FILENAME_ENV);109 const char *filename = NULL; 108 110 109 111 va_start(va, fmt); 112 113 #if defined(VBOX_AUTH_DEBUG_FILENAME_ENV) 114 filename = getenv (VBOX_AUTH_DEBUG_FILENAME_ENV); 115 #endif /* VBOX_AUTH_DEBUG_FILENAME_ENV */ 116 117 #if defined(VBOX_AUTH_DEBUG_FILENAME_ENV_OLD) 118 if (filename == NULL) 119 { 120 filename = getenv (VBOX_AUTH_DEBUG_FILENAME_ENV_OLD); 121 } 122 #endif /* VBOX_AUTH_DEBUG_FILENAME_ENV_OLD */ 110 123 111 124 if (filename) … … 124 137 125 138 va_end (va); 126 #endif /* V RDP_AUTH_DEBUG_FILENAME_ENV*/127 } 128 129 #ifdef V RDP_PAM_DLLOAD139 #endif /* VBOX_AUTH_DEBUG_FILENAME_ENV || VBOX_AUTH_DEBUG_FILENAME_ENV_OLD */ 140 } 141 142 #ifdef VBOX_AUTH_USE_PAM_DLLOAD 130 143 131 144 static void *gpvLibPam = NULL; … … 151 164 SymMap *iter; 152 165 153 gpvLibPam = dlopen( VRDP_PAM_LIB, RTLD_LAZY | RTLD_GLOBAL);166 gpvLibPam = dlopen(PAM_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL); 154 167 155 168 if (!gpvLibPam) 156 169 { 157 debug_printf("auth_pam_init: dlopen %s failed\n", VRDP_PAM_LIB);170 debug_printf("auth_pam_init: dlopen %s failed\n", PAM_LIB_NAME); 158 171 return PAM_SYSTEM_ERR; 159 172 } … … 203 216 return; 204 217 } 205 #endif /* V RDP_PAM_DLLOAD */218 #endif /* VBOX_AUTH_USE_PAM_DLLOAD */ 206 219 207 220 static const char *auth_get_pam_service (void) 208 221 { 209 const char *service = getenv (V RDP_AUTH_PAM_SERVICE_NAME_ENV);222 const char *service = getenv (VBOX_AUTH_PAM_SERVICE_NAME_ENV); 210 223 211 224 if (service == NULL) 212 225 { 213 service = VRDP_AUTH_PAM_DEFAULT_SERVICE_NAME; 226 service = service = getenv (VBOX_AUTH_PAM_SERVICE_NAME_ENV_OLD); 227 228 if (service == NULL) 229 { 230 service = VBOX_AUTH_PAM_DEFAULT_SERVICE_NAME; 231 } 214 232 } 215 233 … … 285 303 286 304 /* prototype to prevent gcc warning */ 287 DECLEXPORT(AuthResult) AUTHCALL VRDPAuth (PAUTHUUID pUuid, 305 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller, 306 PAUTHUUID pUuid, 288 307 AuthGuestJudgement guestJudgement, 289 308 const char *szUser, 290 309 const char *szPassword, 291 const char *szDomain); 292 DECLEXPORT(AuthResult) AUTHCALL VRDPAuth (PAUTHUUID pUuid, 310 const char *szDomain, 311 int fLogon, 312 unsigned clientId); 313 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller, 314 PAUTHUUID pUuid, 293 315 AuthGuestJudgement guestJudgement, 294 316 const char *szUser, 295 317 const char *szPassword, 296 const char *szDomain) 318 const char *szDomain, 319 int fLogon, 320 unsigned clientId) 297 321 { 298 322 AuthResult result = AuthResultAccessDenied; … … 304 328 305 329 pam_handle_t *pam_handle = NULL; 330 331 /* Only process logon requests. */ 332 if (!fLogon) 333 return result; /* Return value is ignored by the caller. */ 306 334 307 335 debug_printf("u[%s], d[%s], p[%d]\n", szUser, szDomain, szPassword? strlen (szPassword): 0); … … 376 404 377 405 /* Verify the function prototype. */ 378 static PAUTHENTRY gpfnAuthEntry = VRDPAuth;406 static PAUTHENTRY3 gpfnAuthEntry = AuthEntry; -
trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp
r34563 r35943 1 1 /** @file 2 2 * 3 * VBox Remote Desktop Protocol: 4 * External Authentication Library: 3 * VirtualBox External Authentication Library: 5 4 * Simple Authentication. 6 5 */ 7 6 8 7 /* 9 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 10 9 * 11 10 * This file is part of VirtualBox Open Source Edition (OSE), as -
trunk/src/VBox/HostServices/auth/winlogon/winlogon.cpp
r34563 r35943 1 1 /** @file 2 2 * 3 * VBox Remote Desktop Protocol: 4 * External Authentication Library: 3 * VirtualBox External Authentication Library: 5 4 * Windows Logon Authentication. 6 5 */ 7 6 8 7 /* 9 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 10 9 * 11 10 * This file is part of VirtualBox Open Source Edition (OSE), as
Note:
See TracChangeset
for help on using the changeset viewer.