Changeset 63220 in vbox
- Timestamp:
- Aug 9, 2016 4:02:01 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c
r62489 r63220 241 241 typedef struct _PamContext 242 242 { 243 char * szUser;244 char * szPassword;243 char *pszUser; 244 char *pszPassword; 245 245 } PamContext; 246 246 … … 259 259 } 260 260 261 debug_printf("conv: num %d u[%s] p[%d]\n", num_msg, ctx-> szUser, ctx->szPassword? strlen (ctx->szPassword): 0);261 debug_printf("conv: num %d u[%s] p[%d]\n", num_msg, ctx->pszUser, ctx->pszPassword? strlen (ctx->pszPassword): 0); 262 262 263 263 r = (struct pam_response *) calloc (num_msg, sizeof (struct pam_response)); … … 274 274 if (msg[i]->msg_style == PAM_PROMPT_ECHO_OFF) 275 275 { 276 r[i].resp = strdup (ctx-> szPassword);276 r[i].resp = strdup (ctx->pszPassword); 277 277 debug_printf("conv: %d returning password [%d]\n", i, r[i].resp? strlen (r[i].resp): 0); 278 278 } 279 279 else if (msg[i]->msg_style == PAM_PROMPT_ECHO_ON) 280 280 { 281 r[i].resp = strdup (ctx-> szUser);281 r[i].resp = strdup (ctx->pszUser); 282 282 debug_printf("conv: %d returning name [%s]\n", i, r[i].resp); 283 283 } … … 305 305 306 306 /* prototype to prevent gcc warning */ 307 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller, 307 DECLEXPORT(AUTHENTRY3) AuthEntry; 308 309 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *pszCaller, 308 310 PAUTHUUID pUuid, 309 311 AuthGuestJudgement guestJudgement, 310 const char *szUser, 311 const char *szPassword, 312 const char *szDomain, 313 int fLogon, 314 unsigned clientId); 315 DECLEXPORT(AuthResult) AUTHCALL AuthEntry(const char *szCaller, 316 PAUTHUUID pUuid, 317 AuthGuestJudgement guestJudgement, 318 const char *szUser, 319 const char *szPassword, 320 const char *szDomain, 312 const char *pszUser, 313 const char *pszPassword, 314 const char *pszDomain, 321 315 int fLogon, 322 316 unsigned clientId) 323 317 { 324 318 AuthResult result = AuthResultAccessDenied; 325 326 319 int rc; 327 328 320 PamContext ctx; 329 321 struct pam_conv pam_conversation; 330 331 322 pam_handle_t *pam_handle = NULL; 323 324 (void)pszCaller; 325 (void)pUuid; 326 (void)guestJudgement; 327 (void)clientId; 332 328 333 329 /* Only process logon requests. */ … … 335 331 return result; /* Return value is ignored by the caller. */ 336 332 337 debug_printf("u[%s], d[%s], p[%d]\n", szUser, szDomain, szPassword? strlen (szPassword): 0);338 339 ctx. szUser = (char *)szUser;340 ctx. szPassword = (char *)szPassword;333 debug_printf("u[%s], d[%s], p[%d]\n", pszUser, pszDomain, pszPassword ? strlen(pszPassword) : 0); 334 335 ctx.pszUser = (char *)pszUser; 336 ctx.pszPassword = (char *)pszPassword; 341 337 342 338 pam_conversation.conv = conv; … … 349 345 debug_printf("init ok\n"); 350 346 351 rc = fn_pam_start(auth_get_pam_service (), szUser, &pam_conversation, &pam_handle);347 rc = fn_pam_start(auth_get_pam_service (), pszUser, &pam_conversation, &pam_handle); 352 348 353 349 if (rc == PAM_SUCCESS) … … 405 401 } 406 402 407 /* Verify the function prototype. */408 static PAUTHENTRY3 gpfnAuthEntry = AuthEntry;
Note:
See TracChangeset
for help on using the changeset viewer.