mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:55:42 +00:00
[RUNAS] Support the /netonly option and improve the help text
This commit is contained in:
parent
977c129f33
commit
4109072bc8
4 changed files with 45 additions and 13 deletions
|
@ -80,7 +80,7 @@ wmain(
|
|||
LPCWSTR pszArg;
|
||||
int i, result = 0;
|
||||
BOOL bProfile = FALSE, bNoProfile = FALSE;
|
||||
BOOL bEnv = FALSE;
|
||||
BOOL bEnv = FALSE, bNetOnly = FALSE;
|
||||
PWSTR pszUserName = NULL;
|
||||
PWSTR pszDomain = NULL;
|
||||
PWSTR pszCommandLine = NULL;
|
||||
|
@ -122,6 +122,10 @@ wmain(
|
|||
{
|
||||
bProfile = TRUE;
|
||||
}
|
||||
else if (wcsicmp(pszArg, L"netonly") == 0)
|
||||
{
|
||||
bNetOnly = TRUE;
|
||||
}
|
||||
else if (wcsicmp(pszArg, L"noprofile") == 0)
|
||||
{
|
||||
bNoProfile = TRUE;
|
||||
|
@ -224,7 +228,17 @@ wmain(
|
|||
}
|
||||
}
|
||||
|
||||
if (bProfile && bNoProfile)
|
||||
/* Check for incompatible options */
|
||||
if ((bProfile && bNoProfile) ||
|
||||
(bProfile && bNetOnly))
|
||||
{
|
||||
Usage();
|
||||
result = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Check for existing command line and user name */
|
||||
if (pszCommandLine == NULL || pszUserName == NULL)
|
||||
{
|
||||
Usage();
|
||||
result = -1;
|
||||
|
@ -237,6 +251,12 @@ wmain(
|
|||
if (bNoProfile)
|
||||
dwLogonFlags &= ~LOGON_WITH_PROFILE;
|
||||
|
||||
if (bNetOnly)
|
||||
{
|
||||
dwLogonFlags |= LOGON_NETCREDENTIALS_ONLY;
|
||||
dwLogonFlags &= ~LOGON_WITH_PROFILE;
|
||||
}
|
||||
|
||||
DPRINT("User: %S\n", pszUserName);
|
||||
DPRINT("Domain: %S\n", pszDomain);
|
||||
DPRINT("CommandLine: %S\n", pszCommandLine);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue