Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#90 closed Bug (Fixed)

RunAs fails for a Limited User if run-as user's Profile is loaded

Reported by: DaveF Owned by: Valik
Milestone: 3.2.11.12 Component: AutoIt
Version: 3.2.11.0 Severity: Blocking
Keywords: beta, runas, profile Cc:

Description

Using beta 3.2.11.0 on XP SP2:

If the RunAs function is called in a script by a limited user, the RunAs function will fail if the target run-as user's Profile is already loaded; as in the case that another process has already been invoked with the run-as user's credentials with the option to load the user's profile. The failure occurs whether or not RunAs is called with the flag to force-load the run-as user's profile, and whether or not AutoIt spawned the earlier process that loaded the run-as user's profile.

Example code:

; N.B. MUST BE RUN AS A LIMITED USER TO EXHIBIT FAILURE
; declare yourself
Dim $ourPID, $ourPID0, $ourRead
; Run an initial process as the desired user
; This is only significant in this example in that
; it pre-loads the target user's profile; we could
; have right-clicked a program and chosen to Run As...
; this user and achieved the same effect.
$ourPID0 = RunAs("is", @ComputerName, "smacksmack", 1, @SystemDir & '\notepad.exe', @SystemDir)
; Run child task with option to access STDOUT
$ourPID = RunAs("is", @ComputerName, "youwantanother?", 1, @ComSpec & " /c set", @SystemDir, @SW_HIDE, 2)
; Read the child task's STDOUT output
While 1
  $ourRead &= StdoutRead($ourPID)
  If @error Then ExitLoop
WEnd
; Display result
MsgBox(0, "Debug", @AutoItVersion & " yields:" & @CRLF & $ourRead)

Attachments (0)

Change History (5)

comment:1 by Valik, 18 years ago

Owner: set to Valik
Status: newassigned

I must have forgotten to document it, but you *must* be an admin to use RunAs()/RunAsWait().

comment:2 by Valik, 18 years ago

Milestone: Future Release

comment:3 by Valik, 18 years ago

Severity: Blocking

comment:4 by Valik, 18 years ago

Milestone: 3.2.11.11
Resolution: Fixed
Status: assignedclosed

Fixed in version: 3.2.11.11

comment:5 by Valik, 18 years ago

Milestone: 3.2.11.113.2.11.12

Fixed in version: 3.2.11.12

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.