- Timestamp:
- Jun 21, 2022 2:40:37 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/pam/pam_vbox.cpp
r94184 r95327 417 417 * hope. Actually this should never go wrong, as we are generous 418 418 * enough with buffer space. */ 419 for (unsigned i = 0; i < 10; i++)419 for (unsigned i = 0; ; i++) 420 420 { 421 421 void *pvTmpBuf = RTMemRealloc(pvBuf, cbBuf); … … 426 426 &pszValTemp, &u64Timestamp, &pszFlags, 427 427 &cbBuf); 428 } 429 else 430 rc = VERR_NO_MEMORY; 431 432 switch (rc) 433 { 434 case VERR_BUFFER_OVERFLOW: 428 if (rc == VERR_BUFFER_OVERFLOW && i < 10) 435 429 { 436 430 /* Buffer too small, try it with a bigger one next time. */ … … 438 432 continue; /* Try next round. */ 439 433 } 440 441 default: 442 break; 443 } 444 445 /* Everything except VERR_BUFFER_OVERLOW makes us bail out ... */ 446 break; 434 } 435 else 436 rc = VERR_NO_MEMORY; 437 break; /* Everything except VERR_BUFFER_OVERFLOW makes us bail out ... */ 447 438 } 448 439 … … 457 448 /* If we want a property which is read-only on the guest 458 449 * and it is *not* marked as such, deny access! */ 459 pam_vbox_error(hPAM, "pam_vbox_read_prop: key \"%s\" should be read-only on guest but it is not\n", 460 pszKey); 450 pam_vbox_error(hPAM, "pam_vbox_read_prop: key \"%s\" should be read-only on guest but it is not\n", pszKey); 461 451 rc = VERR_ACCESS_DENIED; 462 452 } … … 464 454 else /* No flags, no access! */ 465 455 { 466 pam_vbox_error(hPAM, "pam_vbox_read_prop: key \"%s\" contains no/wrong flags (%s)\n", 467 pszKey, pszFlags); 456 pam_vbox_error(hPAM, "pam_vbox_read_prop: key \"%s\" contains no/wrong flags (%s)\n", pszKey, pszFlags); 468 457 rc = VERR_ACCESS_DENIED; 469 458 } … … 474 463 if (!RTStrPrintf(pszValue, cbValue, "%s", pszValTemp)) 475 464 { 476 pam_vbox_error(hPAM, "pam_vbox_read_prop: could not store value of key \"%s\"\n", 477 pszKey); 465 pam_vbox_error(hPAM, "pam_vbox_read_prop: could not store value of key \"%s\"\n", pszKey); 478 466 rc = VERR_INVALID_PARAMETER; 479 467 } 480 468 481 469 if (RT_SUCCESS(rc)) 482 pam_vbox_log(hPAM, "pam_vbox_read_prop: read key \"%s\"=\"%s\"\n", 483 pszKey, pszValue);484 485 } 486 470 pam_vbox_log(hPAM, "pam_vbox_read_prop: read key \"%s\"=\"%s\"\n", pszKey, pszValue); 471 } 472 } 473 474 RTMemFree(pvBuf); 487 475 pam_vbox_log(hPAM, "pam_vbox_read_prop: read key \"%s\" with rc=%Rrc\n", 488 476 pszKey, rc);
Note:
See TracChangeset
for help on using the changeset viewer.