VirtualBox

Changeset 40714 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 29, 2012 4:08:29 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77173
Message:

VBoxManage modifyvm: added --teleporterpasswordfrom

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r40469 r40714  
    321321                     "                            [--teleporteraddress <address|empty>\n"
    322322                     "                            [--teleporterpassword <password>]\n"
     323                     "                            [--teleporterpasswordfrom  <file>]\n"
    323324                     "                            [--tracing-enabled on|off]\n"
    324325                     "                            [--tracing-config <config-string>]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r40418 r40714  
    3030
    3131#include <iprt/cidr.h>
     32#include <iprt/ctype.h>
     33#include <iprt/file.h>
    3234#include <iprt/param.h>
    3335#include <iprt/path.h>
     
    164166    MODIFYVM_TELEPORTER_ADDRESS,
    165167    MODIFYVM_TELEPORTER_PASSWORD,
     168    MODIFYVM_TELEPORTER_PASSWORD_FROM,
    166169    MODIFYVM_TRACING_ENABLED,
    167170    MODIFYVM_TRACING_CONFIG,
     
    302305    { "--teleporteraddress",        MODIFYVM_TELEPORTER_ADDRESS,        RTGETOPT_REQ_STRING },
    303306    { "--teleporterpassword",       MODIFYVM_TELEPORTER_PASSWORD,       RTGETOPT_REQ_STRING },
     307    { "--teleporterpasswordfrom",   MODIFYVM_TELEPORTER_PASSWORD_FROM,  RTGETOPT_REQ_STRING },
    304308    { "--tracing-enabled",          MODIFYVM_TRACING_ENABLED,           RTGETOPT_REQ_BOOL_ONOFF },
    305309    { "--tracing-config",           MODIFYVM_TRACING_CONFIG,            RTGETOPT_REQ_STRING },
     
    22102214            }
    22112215
     2216            case MODIFYVM_TELEPORTER_PASSWORD_FROM:
     2217            {
     2218                size_t cbFile;
     2219                char *pszFileBuf;
     2220                int vrc = RTFileReadAll(ValueUnion.psz, (void**)&pszFileBuf, &cbFile);
     2221                if (RT_SUCCESS(vrc))
     2222                {
     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()));
     2231                }
     2232                else
     2233                    errorArgument("Cannot open password file '%s' (%Rrc)", ValueUnion.psz, vrc);
     2234                break;
     2235            }
     2236
    22122237            case MODIFYVM_TRACING_ENABLED:
    22132238            {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette