Changeset 94660 in vbox for trunk/src/VBox/Frontends/VBoxHeadless
- Timestamp:
- Apr 21, 2022 8:38:34 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151023
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r93460 r94660 419 419 " \"TCP/Address\" - interface IP the VRDE\n" 420 420 " server will bind to\n" 421 " --settingspw <pw> Specify the settings password\n"421 " --settingspw <pw> Specify the VirtualBox settings password\n" 422 422 " --settingspwfile <file> Specify a file containing the\n" 423 " settings password\n" 423 " VirtualBox settings password\n" 424 " --password <file>|- Specify the VM password. Either file containing\n" 425 " the VM password or \"-\" to read it from console\n" 426 " --password-id <id> Specify the password id for the VM password\n" 424 427 " -start-paused, --start-paused Start the VM in paused state\n" 425 428 #ifdef VBOX_WITH_RECORDING … … 827 830 OPT_SETTINGSPW_FILE, 828 831 OPT_COMMENT, 829 OPT_PAUSED 832 OPT_PAUSED, 833 OPT_VMPW, 834 OPT_VMPWID 830 835 }; 831 836 … … 846 851 { "--settingspw", OPT_SETTINGSPW, RTGETOPT_REQ_STRING }, 847 852 { "--settingspwfile", OPT_SETTINGSPW_FILE, RTGETOPT_REQ_STRING }, 853 { "--password", OPT_VMPW, RTGETOPT_REQ_STRING }, 854 { "--password-id", OPT_VMPWID, RTGETOPT_REQ_STRING }, 848 855 #ifdef VBOX_WITH_RECORDING 849 856 { "-record", 'c', 0 }, … … 866 873 const char *pcszSettingsPw = NULL; 867 874 const char *pcszSettingsPwFile = NULL; 875 const char *pcszVmPassword = NULL; 876 const char *pcszVmPasswordId = NULL; 868 877 RTGETOPTUNION ValueUnion; 869 878 RTGETOPTSTATE GetState; … … 898 907 case OPT_SETTINGSPW_FILE: 899 908 pcszSettingsPwFile = ValueUnion.psz; 909 break; 910 case OPT_VMPW: 911 pcszVmPassword = ValueUnion.psz; 912 break; 913 case OPT_VMPWID: 914 pcszVmPasswordId = ValueUnion.psz; 900 915 break; 901 916 case OPT_PAUSED: … … 1057 1072 } 1058 1073 1074 /* add VM password if required */ 1075 if (pcszVmPassword && pcszVmPasswordId) 1076 { 1077 com::Utf8Str strPassword; 1078 if (!RTStrCmp(pcszVmPassword, "-")) 1079 { 1080 /* Get password from console. */ 1081 RTEXITCODE rcExit = readPasswordFromConsole(&strPassword, "Enter the password:"); 1082 if (rcExit == RTEXITCODE_FAILURE) 1083 break; 1084 } 1085 else 1086 { 1087 RTEXITCODE rcExit = readPasswordFile(pcszVmPassword, &strPassword); 1088 if (rcExit != RTEXITCODE_SUCCESS) 1089 break; 1090 } 1091 CHECK_ERROR_BREAK(m, AddEncryptionPassword(Bstr(pcszVmPasswordId).raw(), 1092 Bstr(strPassword).raw())); 1093 } 1059 1094 Bstr bstrVMId; 1060 1095 rc = m->COMGETTER(Id)(bstrVMId.asOutParam());
Note:
See TracChangeset
for help on using the changeset viewer.