Changeset 54591 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 2, 2015 7:55:29 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r54525 r54591 1679 1679 break; 1680 1680 } 1681 1681 } 1682 else if (!strcmp(a->argv[1], "addencpassword")) 1683 { 1684 if ( a->argc != 4 1685 && a->argc != 6) 1686 { 1687 errorSyntax(USAGE_CONTROLVM, "Incorrect number of parameters"); 1688 break; 1689 } 1690 1691 if ( strcmp(a->argv[4], "--removeonsuspend") 1692 || ( strcmp(a->argv[5], "yes") 1693 && strcmp(a->argv[5], "no"))) 1694 { 1695 errorSyntax(USAGE_CONTROLVM, "Invalid parameters"); 1696 break; 1697 } 1698 1699 BOOL fRemoveOnSuspend = FALSE; 1700 Bstr bstrPwId(a->argv[2]); 1701 Bstr bstrPw(a->argv[3]); 1702 if ( a->argc == 6 1703 && !strcmp(a->argv[5], "yes")) 1704 fRemoveOnSuspend = TRUE; 1705 1706 CHECK_ERROR_BREAK(console, AddDiskEncryptionPassword(bstrPwId.raw(), bstrPw.raw(), fRemoveOnSuspend)); 1707 } 1708 else if (!strcmp(a->argv[1], "removeencpassword")) 1709 { 1710 if (a->argc != 3) 1711 { 1712 errorSyntax(USAGE_CONTROLVM, "Incorrect number of parameters"); 1713 break; 1714 } 1715 Bstr bstrPwId(a->argv[2]); 1716 CHECK_ERROR_BREAK(console, RemoveDiskEncryptionPassword(bstrPwId.raw())); 1717 } 1718 else if (!strcmp(a->argv[1], "removeallencpasswords")) 1719 { 1720 CHECK_ERROR_BREAK(console, ClearAllDiskEncryptionPasswords()); 1682 1721 } 1683 1722 else -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r54500 r54591 1641 1641 static const RTGETOPTDEF g_aEncryptMediumOptions[] = 1642 1642 { 1643 { "--newpassword", 'n', RTGETOPT_REQ_STRING }, 1644 { "--oldpassword", 'o', RTGETOPT_REQ_STRING }, 1645 { "--cipher", 'c', RTGETOPT_REQ_STRING } 1643 { "--newpassword", 'n', RTGETOPT_REQ_STRING }, 1644 { "--oldpassword", 'o', RTGETOPT_REQ_STRING }, 1645 { "--cipher", 'c', RTGETOPT_REQ_STRING }, 1646 { "--newpasswordid", 'i', RTGETOPT_REQ_STRING } 1646 1647 }; 1647 1648 … … 1655 1656 const char *pszCipher = NULL; 1656 1657 const char *pszFilenameOrUuid = NULL; 1658 const char *pszNewPasswordId = NULL; 1657 1659 1658 1660 int c; … … 1676 1678 case 'c': // --cipher 1677 1679 pszCipher = ValueUnion.psz; 1680 break; 1681 1682 case 'i': // --newpasswordid 1683 pszNewPasswordId = ValueUnion.psz; 1678 1684 break; 1679 1685 … … 1708 1714 return errorSyntax(USAGE_ENCRYPTMEDIUM, "No password specified"); 1709 1715 1716 if ( (pszPasswordNew && !pszNewPasswordId) 1717 || (!pszPasswordNew && pszNewPasswordId)) 1718 return errorSyntax(USAGE_ENCRYPTMEDIUM, "A new password must always have a valid identifier set at the same time"); 1719 1710 1720 /* Always open the medium if necessary, there is no other way. */ 1711 1721 rc = openMedium(a, pszFilenameOrUuid, DeviceType_HardDisk, … … 1722 1732 ComPtr<IProgress> progress; 1723 1733 CHECK_ERROR(hardDisk, ChangeEncryption(Bstr(pszPasswordNew).raw(), Bstr(pszPasswordOld).raw(), 1724 Bstr(pszCipher).raw(), progress.asOutParam())); 1734 Bstr(pszCipher).raw(), Bstr(pszNewPasswordId).raw(), 1735 progress.asOutParam())); 1725 1736 if (SUCCEEDED(rc)) 1726 1737 rc = showProgress(progress); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r54487 r54591 495 495 " cpuexecutioncap <1-100>\n" 496 496 " webcam <attach [path [settings]]> | <detach [path]> | <list>\n" 497 " addencpassword <id>\n" 498 " <password>\n" 499 " [--removeonsuspend <yes|no>]\n" 500 " removeencpassword <id>\n" 501 " removeallencpasswords\n" 497 502 "\n", SEP); 498 503 } … … 637 642 " [--oldpassword <old password>]\n" 638 643 " [--cipher <cipher identifier>]\n" 644 " [--newpasswordid <password identifier>]\n" 639 645 "\n", SEP); 640 646
Note:
See TracChangeset
for help on using the changeset viewer.