VirtualBox

Changeset 42445 in vbox


Ignore:
Timestamp:
Jul 30, 2012 12:55:12 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79575
Message:

Frontends/VBoxManage,doc/manual: more password file handling touchups, documentation update

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/en_US/user_VBoxManage.xml

    r41878 r42445  
    13941394        <listitem>
    13951395          <para><computeroutput>VBoxManage controlvm &lt;vm&gt; teleport
    1396           --hostname &lt;name&gt; --port &lt;port&gt; [--password
    1397           &lt;password&gt;]</computeroutput> makes the machine the source of a
    1398           teleporting operation and initiates a teleport to the given target.
    1399           See <xref linkend="teleporting" /> for an introduction. If the
    1400           optional password is specified, it must match the password that was
    1401           given to the <computeroutput>modifyvm</computeroutput> command for
    1402           the target machine; see <xref
    1403           linkend="vboxmanage-modifyvm-teleport" /> for details.</para>
     1396          --hostname &lt;name&gt; --port &lt;port&gt; [--passwordfile
     1397          &lt;file&gt; | --password &lt;password&gt;]</computeroutput> makes
     1398          the machine the source of a teleporting operation and initiates a
     1399          teleport to the given target. See <xref linkend="teleporting" /> for
     1400          an introduction. If the optional password is specified, it must match
     1401          the password that was given to the
     1402          <computeroutput>modifyvm</computeroutput> command for the target
     1403          machine; see <xref linkend="vboxmanage-modifyvm-teleport" /> for
     1404          details.</para>
    14041405        </listitem>
    14051406      </itemizedlist></para>
     
    26032604
    26042605          <screen>VBoxManage guestcontrol &lt;vmname&gt;|&lt;uuid&gt; exec[ute]
    2605             --image &lt;path to program&gt;
    2606             --username &lt;name&gt; [--password &lt;password&gt;]
    2607             [--dos2unix]
     2606            --image &lt;path to program&gt; --username &lt;name&gt;
     2607            [--passwordfile &lt;file&gt; | --password &lt;password&gt;]
    26082608            [--environment "&lt;NAME&gt;=&lt;VALUE&gt; [&lt;NAME&gt;=&lt;VALUE&gt;]"]
    2609             [--timeout &lt;msec&gt;] [--unix2dos] [--verbose]
     2609            [--verbose] [--timeout &lt;msec&gt;]
    26102610            [--wait-exit] [--wait-stdout] [--wait-stderr]
     2611            [--dos2unix] [--unix2dos]
    26112612            -- [[&lt;argument1&gt;] ... [&lt;argumentN&gt;]]</screen>
    26122613
     
    26362637                  <para>Name of the user the process should run under. This
    26372638                  user must exist on the guest OS.</para>
     2639                </glossdef>
     2640              </glossentry>
     2641
     2642              <glossentry>
     2643                <glossterm>--passwordfile &lt;file&gt;</glossterm>
     2644
     2645                <glossdef>
     2646                  <para>Password of the user account specified to be read from
     2647                  the given file. If not given, an empty password is
     2648                  assumed.</para>
    26382649                </glossdef>
    26392650              </glossentry>
     
    27582769              information.</para>
    27592770            </note> Examples: <screen>VBoxManage --nologo guestcontrol "My VM" execute --image "/bin/ls"
    2760           --username foo --password bar --wait-exit --wait-stdout -- -l /usr</screen> <screen>VBoxManage --nologo guestcontrol "My VM" execute --image "c:\\windows\\system32\\ipconfig.exe"
    2761           --username foo --password bar --wait-exit --wait-stdout</screen> Note that
     2771          --username foo --passwordfile bar.txt --wait-exit --wait-stdout -- -l /usr</screen> <screen>VBoxManage --nologo guestcontrol "My VM" execute --image "c:\\windows\\system32\\ipconfig.exe"
     2772          --username foo --passwordfile bar.txt --wait-exit --wait-stdout</screen> Note that
    27622773          the double backslashes in the second example are only required on
    27632774          Unix hosts.</para>
     
    27942805
    27952806          <screen>VBoxManage guestcontrol &lt;vmname&gt;|&lt;uuid&gt; copyto|cp
    2796             &lt;source on host&gt; &lt;destination on guest&gt;
    2797             --username &lt;name&gt; [--password &lt;password&gt;]
     2807            &lt;guest source&gt; &lt;host dest&gt; --username &lt;name&gt;
     2808            [--passwordfile &lt;file&gt; | --password &lt;password&gt;]
    27982809            [--dryrun] [--follow] [--recursive] [--verbose]</screen>
    27992810
     
    28382849
    28392850              <glossentry>
     2851                <glossterm>--passwordfile &lt;file&gt;</glossterm>
     2852
     2853                <glossdef>
     2854                  <para>Password of the user account specified to be read from
     2855                  the given file. If not given, an empty password is
     2856                  assumed.</para>
     2857                </glossdef>
     2858              </glossentry>
     2859
     2860              <glossentry>
    28402861                <glossterm>--password &lt;password&gt;</glossterm>
    28412862
     
    28942915
    28952916        <listitem>
     2917          <para><computeroutput>copyfrom</computeroutput>, which allows copying
     2918          files from the guest to the host (only with installed Guest
     2919          Additions 4.0 and later). It has the same parameters as
     2920          <computeroutput>copyto</computeroutput> above.</para>
     2921        </listitem>
     2922
     2923        <listitem>
    28962924          <para><computeroutput>createdirectory</computeroutput>, which allows
    28972925          copying files from the host to the guest (only with installed Guest
     
    28992927
    29002928          <screen>VBoxManage guestcontrol &lt;vmname&gt;|&lt;uuid&gt; createdir[ectory]|mkdir|md
    2901             &lt;directory to create on guest&gt;
    2902             [--username "&lt;name&gt;"] [--password "&lt;password&gt;"]
     2929            &lt;guest directory&gt;... --username &lt;name&gt;
     2930            [--passwordfile &lt;file&gt; | --password &lt;password&gt;]
    29032931            [--parents] [--mode &lt;mode&gt;] [--verbose]</screen>
    29042932
     
    29362964
    29372965              <glossentry>
     2966                <glossterm>--passwordfile &lt;file&gt;</glossterm>
     2967
     2968                <glossdef>
     2969                  <para>Password of the user account specified to be read from
     2970                  the given file. If not given, an empty password is
     2971                  assumed.</para>
     2972                </glossdef>
     2973              </glossentry>
     2974
     2975              <glossentry>
    29382976                <glossterm>--password &lt;password&gt;</glossterm>
    29392977
     
    29853023
    29863024          <screen>VBoxManage guestcontrol &lt;vmname&gt;|&lt;uuid&gt; stat
    2987             &lt;file element(s) to check on guest&gt;
    2988             [--username "&lt;name&gt;"] [--password "&lt;password&gt;"]
     3025            &lt;file&gt;... --username &lt;name&gt;
     3026            [--passwordfile &lt;file&gt; | --password &lt;password&gt;]
    29893027            [--verbose]</screen>
    29903028
     
    30153053                  <para>Name of the user the copy process should run under.
    30163054                  This user must exist on the guest OS.</para>
     3055                </glossdef>
     3056              </glossentry>
     3057
     3058              <glossentry>
     3059                <glossterm>--passwordfile &lt;file&gt;</glossterm>
     3060
     3061                <glossdef>
     3062                  <para>Password of the user account specified to be read from
     3063                  the given file. If not given, an empty password is
     3064                  assumed.</para>
    30173065                </glossdef>
    30183066              </glossentry>
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r42444 r42445  
    11521152            uint32_t    uPort        = UINT32_MAX;
    11531153            uint32_t    cMsTimeout   = 0;
    1154             Bstr        bstrPassword("");
     1154            Utf8Str     strPassword;
    11551155            static const RTGETOPTDEF s_aTeleportOptions[] =
    11561156            {
     
    11581158                { "--hostname",          'h', RTGETOPT_REQ_STRING }, /** @todo remove this */
    11591159                { "--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 },
    11621163                { "--timeout",           't', RTGETOPT_REQ_UINT32 },
    11631164                { "--detailed-progress", 'D', RTGETOPT_REQ_NOTHING }
     
    11751176                    case 'd': uMaxDowntime  = Value.u32; break;
    11761177                    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;
    11791187                    case 't': cMsTimeout    = Value.u32; break;
    11801188                    default:
     
    11891197            ComPtr<IProgress> progress;
    11901198            CHECK_ERROR_BREAK(console, Teleport(bstrHostname.raw(), uPort,
    1191                                                 bstrPassword.raw(),
     1199                                                Bstr(strPassword).raw(),
    11921200                                                uMaxDowntime,
    11931201                                                progress.asOutParam()));
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r42444 r42445  
    224224                 "                            exec[ute]\n"
    225225                 "                            --image <path to program> --username <name>\n"
    226                  "                            --passwordfile <file> | --password <password>\n"
     226                 "                            [--passwordfile <file> | --password <password>]\n"
    227227                 "                            [--environment \"<NAME>=<VALUE> [<NAME>=<VALUE>]\"]\n"
    228228                 "                            [--verbose] [--timeout <msec>]\n"
     
    235235                 "                            copyfrom\n"
    236236                 "                            <guest source> <host dest> --username <name>\n"
    237                  "                            --passwordfile <file> | --password <password>\n"
     237                 "                            [--passwordfile <file> | --password <password>]\n"
    238238                 "                            [--dryrun] [--follow] [--recursive] [--verbose]\n"
    239239                 "\n"
    240240                 "                            copyto|cp\n"
    241241                 "                            <host source> <guest dest> --username <name>\n"
    242                  "                            --passwordfile <file> | --password <password>\n"
     242                 "                            [--passwordfile <file> | --password <password>]\n"
    243243                 "                            [--dryrun] [--follow] [--recursive] [--verbose]\n"
    244244                 "\n"
    245245                 "                            createdir[ectory]|mkdir|md\n"
    246246                 "                            <guest directory>... --username <name>\n"
    247                  "                            --passwordfile <file> | --password <password>\n"
     247                 "                            [--passwordfile <file> | --password <password>]\n"
    248248                 "                            [--parents] [--mode <mode>] [--verbose]\n"
    249249                 "\n"
    250250                 "                            stat\n"
    251251                 "                            <file>... --username <name>\n"
    252                  "                            --passwordfile <file> | --password <password>\n"
     252                 "                            [--passwordfile <file> | --password <password>]\n"
    253253                 "                            [--verbose]\n"
    254254                 "\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r42444 r42445  
    347347                     "                            [--autostart-enabled on|off]\n"
    348348                     "                            [--autostart-delay <seconds>]\n"
    349                      "                            [--autostop-type disabled|savestate|poweroff|acpishutdown]\n"
     349                     "                            [--autostop-type disabled|savestate|poweroff|\n"
     350                     "                                             acpishutdown]\n"
    350351                     "\n");
    351352    }
     
    444445                     "                                           [--allowlocallogon <yes|no>] |\n"
    445446                     "                            teleport --host <name> --port <port>\n"
    446                      "                                   [--maxdowntime <msec>] [--password password]\n"
     447                     "                                     [--maxdowntime <msec>]\n"
     448                     "                                     [--passwordfile <file> |\n"
     449                     "                                      --password <password>]\n"
    447450                     "                            plugcpu <id>\n"
    448451                     "                            unplugcpu <id>\n"
     
    529532        RTStrmPrintf(pStrm,
    530533                     "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"
    533538                     "                            remove <name> |\n"
    534539                     "                            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"
    536542                     "\n");
    537543
     
    680686                     "                            getregisters [--cpu <id>] <reg>|all ... |\n"
    681687                     "                            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"
    684692                     "                            statistics [--reset] [--pattern <pattern>]\n"
    685693                     "                            [--descriptions]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r42381 r42445  
    22772277            case MODIFYVM_TELEPORTER_PASSWORD_FILE:
    22782278            {
    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()));
    23092285                break;
    23102286            }
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