Changeset 40724 in vbox
- Timestamp:
- Mar 30, 2012 11:21:27 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77189
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r40714 r40724 321 321 " [--teleporteraddress <address|empty>\n" 322 322 " [--teleporterpassword <password>]\n" 323 " [--teleporterpasswordfrom <file> ]\n"323 " [--teleporterpasswordfrom <file>|-]\n" 324 324 " [--tracing-enabled on|off]\n" 325 325 " [--tracing-config <config-string>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r40714 r40724 2217 2217 { 2218 2218 size_t cbFile; 2219 char *pszFileBuf; 2220 int vrc = RTFileReadAll(ValueUnion.psz, (void**)&pszFileBuf, &cbFile); 2219 char szPasswd[512]; 2220 int vrc = VINF_SUCCESS; 2221 bool fStdIn = !strcmp(ValueUnion.psz, "-"); 2222 PRTSTREAM pStrm; 2223 if (!fStdIn) 2224 vrc = RTStrmOpen(ValueUnion.psz, "r", &pStrm); 2225 else 2226 pStrm = g_pStdIn; 2221 2227 if (RT_SUCCESS(vrc)) 2222 2228 { 2223 char szPasswd[512]; 2224 for (unsigned i = 0; 2225 i < cbFile 2226 && i < sizeof(szPasswd)-1 2227 && !RT_C_IS_CNTRL(pszFileBuf[i]); i++) 2228 szPasswd[i] = pszFileBuf[i]; 2229 2230 CHECK_ERROR(machine, COMSETTER(TeleporterPassword)(Bstr(szPasswd).raw())); 2229 vrc = RTStrmReadEx(pStrm, szPasswd, sizeof(szPasswd)-1, &cbFile); 2230 if (RT_SUCCESS(vrc)) 2231 { 2232 if (cbFile >= sizeof(szPasswd)-1) 2233 errorArgument("Provided password too long"); 2234 else 2235 { 2236 unsigned i; 2237 for (i = 0; i < cbFile && !RT_C_IS_CNTRL(szPasswd[i]); i++) 2238 ; 2239 szPasswd[i] = '\0'; 2240 CHECK_ERROR(machine, COMSETTER(TeleporterPassword)(Bstr(szPasswd).raw())); 2241 } 2242 } 2243 if (!fStdIn) 2244 RTStrmClose(pStrm); 2231 2245 } 2232 2246 else
Note:
See TracChangeset
for help on using the changeset viewer.