VirtualBox

Changeset 102540 in vbox


Ignore:
Timestamp:
Dec 8, 2023 12:43:07 PM (14 months ago)
Author:
vboxsync
Message:

VBoxManage/Unattended: Added password file support for the admin password. Renamed "--password-file" (kept for backwards compatibility though) to "--user-password-file". Updated docs. bugref:10554

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/en_US/man_VBoxManage-unattended.xml

    r102538 r102540  
    137137        </varlistentry>
    138138        <varlistentry>
     139          <term><option>--user-password-file=<replaceable>file</replaceable></option></term>
     140          <listitem>
     141            <para>Alternative to <option>--user-password</option> for providing the user password.  Special filename
     142              <computeroutput>stdin</computeroutput> can be used to read the password from standard input.</para></listitem>
     143        </varlistentry>
     144        <varlistentry>
    139145          <term><option>--admin-password=<replaceable>password</replaceable></option></term>
    140146          <listitem>
     
    143149        </varlistentry>
    144150        <varlistentry>
    145           <term><option>--password-file=<replaceable>file</replaceable></option></term>
    146           <listitem>
    147             <para>Alternative to <option>--password</option> for providing the password.  Special filename
     151          <term><option>--admin-password-file=<replaceable>file</replaceable></option></term>
     152          <listitem>
     153            <para>Alternative to <option>--admin-password</option> for providing the admin / root password.  Special filename
    148154              <computeroutput>stdin</computeroutput> can be used to read the password from standard input.</para></listitem>
    149155        </varlistentry>
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp

    r102539 r102540  
    21332133    enum kUnattendedInstallOpt
    21342134    {
    2135         kUnattendedInstallOpt_AdminPassword = 1000
     2135        kUnattendedInstallOpt_AdminPassword = 1000,
     2136        kUnattendedInstallOpt_AdminPasswordFile
    21362137    };
    21372138    static const RTGETOPTDEF s_aOptions[] =
     
    21422143        { "--password-file",                    'X', RTGETOPT_REQ_STRING }, /* Keep for backwards compatibility! */
    21432144        { "--user-password",                    'p', RTGETOPT_REQ_STRING },
     2145        { "--user-password-file",               'X', RTGETOPT_REQ_STRING },
    21442146        { "--admin-password",                   kUnattendedInstallOpt_AdminPassword, RTGETOPT_REQ_STRING },
     2147        { "--admin-password-file",              kUnattendedInstallOpt_AdminPasswordFile, RTGETOPT_REQ_STRING },
    21452148        { "--full-user-name",                   'U', RTGETOPT_REQ_STRING },
    21462149        { "--key",                              'k', RTGETOPT_REQ_STRING },
     
    22082211                break;
    22092212
    2210             case 'X':   // --password-file
     2213            case 'X':   // --[user-]password-file
    22112214            {
    22122215                Utf8Str strPassword;
     
    22152218                    return rcExit;
    22162219                CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(UserPassword)(Bstr(strPassword).raw()), RTEXITCODE_FAILURE);
     2220                break;
     2221            }
     2222
     2223            case kUnattendedInstallOpt_AdminPasswordFile:
     2224            {
     2225                Utf8Str strPassword;
     2226                RTEXITCODE rcExit = readPasswordFile(ValueUnion.psz, &strPassword);
     2227                if (rcExit != RTEXITCODE_SUCCESS)
     2228                    return rcExit;
     2229                CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(AdminPassword)(Bstr(strPassword).raw()), RTEXITCODE_FAILURE);
    22172230                break;
    22182231            }
Note: See TracChangeset for help on using the changeset viewer.

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