Changeset 34558 in vbox for trunk/src/VBox/HostServices/auth
- Timestamp:
- Dec 1, 2010 10:56:44 AM (14 years ago)
- Location:
- trunk/src/VBox/HostServices/auth
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/auth/Makefile.kmk
r33185 r34558 44 44 # Install the SDK samples. 45 45 INSTALLS += VBoxAuth-samples 46 VBoxAuth-samples_INST = $(INST_SDK)/bindings/ vrdpauth/46 VBoxAuth-samples_INST = $(INST_SDK)/bindings/auth/ 47 47 VBoxAuth-samples_MODE = a+r,u+w 48 48 VBoxAuth-samples_SOURCES = simple/VBoxAuthSimple.cpp … … 52 52 # Install the SDK header. 53 53 INSTALLS += VBoxAuth-sdkhdr 54 VBoxAuth-sdkhdr_INST = $(INST_SDK)/bindings/ vrdpauth/include/54 VBoxAuth-sdkhdr_INST = $(INST_SDK)/bindings/auth/include/ 55 55 VBoxAuth-sdkhdr_MODE = a+r,u+w 56 56 VBoxAuth-sdkhdr_SOURCES = $(PATH_ROOT)/include/VBox/VRDPAuth.h=>VRDPAuth.h -
trunk/src/VBox/HostServices/auth/directoryservice/directoryservice.cpp
r33185 r34558 258 258 259 259 RT_C_DECLS_BEGIN 260 DECLEXPORT( VRDPAuthResult) VRDPAUTHCALL VRDPAuth(PVRDPAUTHUUID pUuid,261 VRDPAuthGuestJudgement guestJudgement,262 263 264 260 DECLEXPORT(AuthResult) AUTHCALL VRDPAuth(PAUTHUUID pUuid, 261 AuthGuestJudgement guestJudgement, 262 const char *pszUser, 263 const char *pszPassword, 264 const char *pszDomain) 265 265 { 266 266 /* Validate input */ 267 AssertPtrReturn(pszUser, VRDPAuthAccessDenied);268 AssertPtrReturn(pszPassword, VRDPAuthAccessDenied);267 AssertPtrReturn(pszUser, AuthResultAccessDenied); 268 AssertPtrReturn(pszPassword, AuthResultAccessDenied); 269 269 270 270 /* Result to a default value */ 271 VRDPAuthResult result = VRDPAuthAccessDenied;271 AuthResult result = AuthResultAccessDenied; 272 272 273 273 tDirStatus dsErr = eDSNoErr; … … 299 299 dsErr = authWithNode(pDirRef, pAuthNodeList, pszUser, pszPassword); 300 300 if (dsErr == eDSNoErr) 301 result = VRDPAuthAccessGranted;301 result = AuthResultAccessGranted; 302 302 dsCleanErr = dsDataListDeallocate(pDirRef, pAuthNodeList); 303 303 if (dsCleanErr == eDSNoErr) … … 317 317 RT_C_DECLS_END 318 318 319 static P VRDPAUTHENTRY gpfnAuthEntry = VRDPAuth;320 319 static PAUTHENTRY gpfnAuthEntry = VRDPAuth; 320 -
trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c
r33185 r34558 147 147 }; 148 148 149 static int vrdpauth_pam_init(void)149 static int auth_pam_init(void) 150 150 { 151 151 SymMap *iter; … … 155 155 if (!gpvLibPam) 156 156 { 157 debug_printf(" vrdpauth_pam_init: dlopen %s failed\n", VRDP_PAM_LIB);157 debug_printf("auth_pam_init: dlopen %s failed\n", VRDP_PAM_LIB); 158 158 return PAM_SYSTEM_ERR; 159 159 } … … 167 167 if (pv == NULL) 168 168 { 169 debug_printf(" vrdpauth_pam_init: dlsym %s failed\n", iter->pszName);169 debug_printf("auth_pam_init: dlsym %s failed\n", iter->pszName); 170 170 171 171 dlclose(gpvLibPam); … … 183 183 } 184 184 185 static void vrdpauth_pam_close(void)185 static void auth_pam_close(void) 186 186 { 187 187 if (gpvLibPam) … … 194 194 } 195 195 #else 196 static int vrdpauth_pam_init(void)196 static int auth_pam_init(void) 197 197 { 198 198 return PAM_SUCCESS; 199 199 } 200 200 201 static void vrdpauth_pam_close(void)201 static void auth_pam_close(void) 202 202 { 203 203 return; … … 205 205 #endif /* VRDP_PAM_DLLOAD */ 206 206 207 static const char * vrdpauth_get_pam_service (void)207 static const char *auth_get_pam_service (void) 208 208 { 209 209 const char *service = getenv (VRDP_AUTH_PAM_SERVICE_NAME_ENV); … … 273 273 } 274 274 275 /* The VRDPAuthentry point must be visible. */275 /* The entry point must be visible. */ 276 276 #if defined(_MSC_VER) || defined(__OS2__) 277 277 # define DECLEXPORT(type) __declspec(dllexport) type … … 285 285 286 286 /* prototype to prevent gcc warning */ 287 DECLEXPORT( VRDPAuthResult) VRDPAUTHCALL VRDPAuth (PVRDPAUTHUUID pUuid,288 VRDPAuthGuestJudgement guestJudgement,289 290 291 292 DECLEXPORT( VRDPAuthResult) VRDPAUTHCALL VRDPAuth (PVRDPAUTHUUID pUuid,293 VRDPAuthGuestJudgement guestJudgement,294 295 296 297 { 298 VRDPAuthResult result = VRDPAuthAccessDenied;287 DECLEXPORT(AuthResult) AUTHCALL VRDPAuth (PAUTHUUID pUuid, 288 AuthGuestJudgement guestJudgement, 289 const char *szUser, 290 const char *szPassword, 291 const char *szDomain); 292 DECLEXPORT(AuthResult) AUTHCALL VRDPAuth (PAUTHUUID pUuid, 293 AuthGuestJudgement guestJudgement, 294 const char *szUser, 295 const char *szPassword, 296 const char *szDomain) 297 { 298 AuthResult result = AuthResultAccessDenied; 299 299 300 300 int rc; … … 313 313 pam_conversation.appdata_ptr = &ctx; 314 314 315 rc = vrdpauth_pam_init ();315 rc = auth_pam_init (); 316 316 317 317 if (rc == PAM_SUCCESS) … … 319 319 debug_printf("init ok\n"); 320 320 321 rc = fn_pam_start( vrdpauth_get_pam_service (), szUser, &pam_conversation, &pam_handle);321 rc = fn_pam_start(auth_get_pam_service (), szUser, &pam_conversation, &pam_handle); 322 322 323 323 if (rc == PAM_SUCCESS) … … 344 344 debug_printf("access granted\n"); 345 345 346 result = VRDPAuthAccessGranted;346 result = AuthResultAccessGranted; 347 347 } 348 348 else … … 363 363 } 364 364 365 vrdpauth_pam_close ();366 367 debug_printf(" vrdpauth_pam_close completed\n");365 auth_pam_close (); 366 367 debug_printf("auth_pam_close completed\n"); 368 368 } 369 369 else 370 370 { 371 debug_printf(" vrdpauth_pam_init failed %d\n", rc);371 debug_printf("auth_pam_init failed %d\n", rc); 372 372 } 373 373 … … 376 376 377 377 /* Verify the function prototype. */ 378 static P VRDPAUTHENTRY gpfnAuthEntry = VRDPAuth;378 static PAUTHENTRY gpfnAuthEntry = VRDPAuth; -
trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp
r33294 r34558 51 51 52 52 FILE *f = fopen(VRDPAUTH_DEBUG_FILE_NAME, "ab"); 53 fprintf(f, "%s", buffer); 54 fclose(f); 53 if (f) 54 { 55 fprintf(f, "%s", buffer); 56 fclose(f); 57 } 55 58 56 59 va_end (va); … … 59 62 60 63 RT_C_DECLS_BEGIN 61 DECLEXPORT(VRDPAuthResult) VRDPAUTHCALL VRDPAuth2(PVRDPAUTHUUID pUuid, 62 VRDPAuthGuestJudgement guestJudgement, 63 const char *szUser, 64 const char *szPassword, 65 const char *szDomain, 66 int fLogon, 67 unsigned clientId) 64 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller, 65 PAUTHUUID pUuid, 66 AuthGuestJudgement guestJudgement, 67 const char *szUser, 68 const char *szPassword, 69 const char *szDomain, 70 int fLogon, 71 unsigned clientId) 68 72 { 69 73 /* default is failed */ 70 VRDPAuthResult result = VRDPAuthAccessDenied;74 AuthResult result = AuthResultAccessDenied; 71 75 72 76 /* only interested in logon */ … … 117 121 118 122 if (password == pszDigest) 119 result = VRDPAuthAccessGranted;123 result = AuthResultAccessGranted; 120 124 } 121 125 } … … 126 130 127 131 /* Verify the function prototype. */ 128 static P VRDPAUTHENTRY2 gpfnAuthEntry = VRDPAuth2;132 static PAUTHENTRY3 gpfnAuthEntry = AuthEntry; -
trunk/src/VBox/HostServices/auth/winlogon/winlogon.cpp
r33185 r34558 19 19 20 20 /* If defined, debug messages will be written to the specified file. */ 21 // #define VRDPAUTH_DEBUG_FILE_NAME "\\VRDPAuth.log"21 // #define AUTH_DEBUG_FILE_NAME "\\VBoxAuth.log" 22 22 23 23 #include <stdio.h> … … 30 30 static void dprintf(const char *fmt, ...) 31 31 { 32 #ifdef AUTH_DEBUG_FILE_NAME 32 33 va_list va; 33 34 … … 40 41 OutputDebugStringA(buffer); 41 42 42 #ifdef VRDPAUTH_DEBUG_FILE_NAME 43 FILE *f = fopen (VRDPAUTH_DEBUG_FILE_NAME, "ab"); 44 fprintf (f, "%s", buffer); 45 fclose (f); 46 #endif 43 FILE *f = fopen (AUTH_DEBUG_FILE_NAME, "ab"); 44 if (f) 45 { 46 fprintf (f, "%s", buffer); 47 fclose (f); 48 } 47 49 48 50 va_end (va); 51 #endif 49 52 } 50 53 … … 53 56 __declspec(dllexport) 54 57 #endif 55 VRDPAuthResult VRDPAUTHCALL VRDPAuth (PVRDPAUTHUUID pUuid, 56 VRDPAuthGuestJudgement guestJudgement, 57 const char *szUser, 58 const char *szPassword, 59 const char *szDomain) 58 AuthResult AUTHCALL AuthEntry (const char *szCaller, 59 PAUTHUUID pUuid, 60 AuthGuestJudgement guestJudgement, 61 const char *szUser, 62 const char *szPassword, 63 const char *szDomain, 64 int fLogon, 65 unsigned clientId) 60 66 { 61 VRDPAuthResult result = VRDPAuthAccessDenied;67 AuthResult result = AuthResultAccessDenied; 62 68 63 69 LPTSTR lpszUsername = (char *)szUser; … … 86 92 dprintf("LogonUser success. hToken = %p\n", hToken); 87 93 88 result = VRDPAuthAccessGranted;94 result = AuthResultAccessGranted; 89 95 90 96 CloseHandle (hToken); … … 99 105 100 106 /* Verify the function prototype. */ 101 static P VRDPAUTHENTRY gpfnAuthEntry = VRDPAuth;107 static PAUTHENTRY3 gpfnAuthEntry = AuthEntry;
Note:
See TracChangeset
for help on using the changeset viewer.