Changeset 42445 in vbox for trunk/src/VBox
- Timestamp:
- Jul 30, 2012 12:55:12 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r42444 r42445 1152 1152 uint32_t uPort = UINT32_MAX; 1153 1153 uint32_t cMsTimeout = 0; 1154 Bstr bstrPassword("");1154 Utf8Str strPassword; 1155 1155 static const RTGETOPTDEF s_aTeleportOptions[] = 1156 1156 { … … 1158 1158 { "--hostname", 'h', RTGETOPT_REQ_STRING }, /** @todo remove this */ 1159 1159 { "--maxdowntime", 'd', RTGETOPT_REQ_UINT32 }, 1160 { "--port", 'p', RTGETOPT_REQ_UINT32 }, /** @todo RTGETOPT_FLAG_MANDATORY */ 1161 { "--password", 'P', RTGETOPT_REQ_STRING }, 1160 { "--port", 'P', RTGETOPT_REQ_UINT32 }, /** @todo RTGETOPT_FLAG_MANDATORY */ 1161 { "--passwordfile", 'p', RTGETOPT_REQ_STRING }, 1162 { "--password", 'W', RTGETOPT_REQ_STRING }, 1162 1163 { "--timeout", 't', RTGETOPT_REQ_UINT32 }, 1163 1164 { "--detailed-progress", 'D', RTGETOPT_REQ_NOTHING } … … 1175 1176 case 'd': uMaxDowntime = Value.u32; break; 1176 1177 case 'D': g_fDetailedProgress = true; break; 1177 case 'p': uPort = Value.u32; break; 1178 case 'P': bstrPassword = Value.psz; break; 1178 case 'P': uPort = Value.u32; break; 1179 case 'p': 1180 { 1181 RTEXITCODE rcExit = readPasswordFile(Value.psz, &strPassword); 1182 if (rcExit != RTEXITCODE_SUCCESS) 1183 rc = E_FAIL; 1184 break; 1185 } 1186 case 'W': strPassword = Value.psz; break; 1179 1187 case 't': cMsTimeout = Value.u32; break; 1180 1188 default: … … 1189 1197 ComPtr<IProgress> progress; 1190 1198 CHECK_ERROR_BREAK(console, Teleport(bstrHostname.raw(), uPort, 1191 bstrPassword.raw(),1199 Bstr(strPassword).raw(), 1192 1200 uMaxDowntime, 1193 1201 progress.asOutParam())); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r42444 r42445 224 224 " exec[ute]\n" 225 225 " --image <path to program> --username <name>\n" 226 " --passwordfile <file> | --password <password>\n"226 " [--passwordfile <file> | --password <password>]\n" 227 227 " [--environment \"<NAME>=<VALUE> [<NAME>=<VALUE>]\"]\n" 228 228 " [--verbose] [--timeout <msec>]\n" … … 235 235 " copyfrom\n" 236 236 " <guest source> <host dest> --username <name>\n" 237 " --passwordfile <file> | --password <password>\n"237 " [--passwordfile <file> | --password <password>]\n" 238 238 " [--dryrun] [--follow] [--recursive] [--verbose]\n" 239 239 "\n" 240 240 " copyto|cp\n" 241 241 " <host source> <guest dest> --username <name>\n" 242 " --passwordfile <file> | --password <password>\n"242 " [--passwordfile <file> | --password <password>]\n" 243 243 " [--dryrun] [--follow] [--recursive] [--verbose]\n" 244 244 "\n" 245 245 " createdir[ectory]|mkdir|md\n" 246 246 " <guest directory>... --username <name>\n" 247 " --passwordfile <file> | --password <password>\n"247 " [--passwordfile <file> | --password <password>]\n" 248 248 " [--parents] [--mode <mode>] [--verbose]\n" 249 249 "\n" 250 250 " stat\n" 251 251 " <file>... --username <name>\n" 252 " --passwordfile <file> | --password <password>\n"252 " [--passwordfile <file> | --password <password>]\n" 253 253 " [--verbose]\n" 254 254 "\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r42444 r42445 347 347 " [--autostart-enabled on|off]\n" 348 348 " [--autostart-delay <seconds>]\n" 349 " [--autostop-type disabled|savestate|poweroff|acpishutdown]\n" 349 " [--autostop-type disabled|savestate|poweroff|\n" 350 " acpishutdown]\n" 350 351 "\n"); 351 352 } … … 444 445 " [--allowlocallogon <yes|no>] |\n" 445 446 " teleport --host <name> --port <port>\n" 446 " [--maxdowntime <msec>] [--password password]\n" 447 " [--maxdowntime <msec>]\n" 448 " [--passwordfile <file> |\n" 449 " --password <password>]\n" 447 450 " plugcpu <id>\n" 448 451 " unplugcpu <id>\n" … … 529 532 RTStrmPrintf(pStrm, 530 533 "VBoxManage bandwidthctl <uuid|vmname>\n" 531 " add <name> --type disk|network --limit <megabytes per second>[k|m|g|K|M|G] |\n" 532 " set <name> --limit <megabytes per second>[k|m|g|K|M|G] |\n" 534 " add <name> --type disk|network\n" 535 " --limit <megabytes per second>[k|m|g|K|M|G] |\n" 536 " set <name>\n" 537 " --limit <megabytes per second>[k|m|g|K|M|G] |\n" 533 538 " remove <name> |\n" 534 539 " list [--machinereadable]\n" 535 " (limit units: k=kilobit, m=megabit, g=gigabit, K=kilobyte, M=megabyte, G=gigabyte)\n" 540 " (limit units: k=kilobit, m=megabit, g=gigabit,\n" 541 " K=kilobyte, M=megabyte, G=gigabyte)\n" 536 542 "\n"); 537 543 … … 680 686 " getregisters [--cpu <id>] <reg>|all ... |\n" 681 687 " setregisters [--cpu <id>] <reg>=<value> ... |\n" 682 " show [--human-readable|--sh-export|--sh-eval|--cmd-set] \n" 683 " <logdbg-settings|logrel-settings> [[opt] what ...] |\n" 688 " show [--human-readable|--sh-export|--sh-eval|\n" 689 " --cmd-set] \n" 690 " <logdbg-settings|logrel-settings>\n" 691 " [[opt] what ...] |\n" 684 692 " statistics [--reset] [--pattern <pattern>]\n" 685 693 " [--descriptions]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r42381 r42445 2277 2277 case MODIFYVM_TELEPORTER_PASSWORD_FILE: 2278 2278 { 2279 size_t cbFile; 2280 char szPasswd[512]; 2281 int vrc = VINF_SUCCESS; 2282 bool fStdIn = !strcmp(ValueUnion.psz, "stdin"); 2283 PRTSTREAM pStrm; 2284 if (!fStdIn) 2285 vrc = RTStrmOpen(ValueUnion.psz, "r", &pStrm); 2286 else 2287 pStrm = g_pStdIn; 2288 if (RT_SUCCESS(vrc)) 2289 { 2290 vrc = RTStrmReadEx(pStrm, szPasswd, sizeof(szPasswd)-1, &cbFile); 2291 if (RT_SUCCESS(vrc)) 2292 { 2293 if (cbFile >= sizeof(szPasswd)-1) 2294 errorArgument("Provided password too long"); 2295 else 2296 { 2297 unsigned i; 2298 for (i = 0; i < cbFile && !RT_C_IS_CNTRL(szPasswd[i]); i++) 2299 ; 2300 szPasswd[i] = '\0'; 2301 CHECK_ERROR(machine, COMSETTER(TeleporterPassword)(Bstr(szPasswd).raw())); 2302 } 2303 } 2304 if (!fStdIn) 2305 RTStrmClose(pStrm); 2306 } 2307 else 2308 errorArgument("Cannot open password file '%s' (%Rrc)", ValueUnion.psz, vrc); 2279 Utf8Str password; 2280 RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &password); 2281 if (rcExit != RTEXITCODE_SUCCESS) 2282 rc = E_FAIL; 2283 else 2284 CHECK_ERROR(machine, COMSETTER(TeleporterPassword)(Bstr(password).raw())); 2309 2285 break; 2310 2286 }
Note:
See TracChangeset
for help on using the changeset viewer.