Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#89 closed Bug (Fixed)

RunAs w/ Profile does not grant acess to user environment

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

Description

Using beta 3.2.11.0 on XP SP2:

In a child process spawned by the RunAs function with the proper flag to force the as-yet unloaded run-as user's profile to load, the child process's environment is that of the Default User rather than the run-as user's, though the other run-as elements of the run-as user's profile (such as the system registry) can be accessed as desired.

Code to reproduce:

; declare yourself
Dim $ourPID, $ourRead
; Run child task with option to load run-as user's profile
$ourPID = RunAs("is", @ComputerName, "smack", 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 (4)

comment:1 by Valik, 18 years ago

Milestone: Future Release
Owner: set to Valik
Status: newassigned

Ahhh hell, good catch, Dave. I see what the problem is.

Note to self: Document that the profile *must* be loaded in order to get environment variables specified in the profile, otherwise a bare-bones environment will be loaded.

comment:2 by J-Paul Mesnage, 18 years ago

Severity: Blocking

comment:3 by Valik, 18 years ago

Milestone: 3.2.11.11
Resolution: Fixed
Status: assignedclosed

Fixed in version: 3.2.11.11

comment:4 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.