Skip to content

CreateProcessWithTokenW get Error code 2 ERROR_FILE_NOT_FOUND in windows 32 bit #54060

Closed

Description

@thisnotfunny

in windows2003(32bit)、windows2008(32bit) ,
when I want to create process with a different user such as ”system” user
to run simple command like “echo abc”,
the CreateProcessWithTokenW will get Error code 2 ERROR_FILE_NOT_FOUND ,
this only happen in in windows 32 bit system
Any one who knows what file not found ?
thanks you very much!

Activity

  1. added this to the Blocked milestone on Jul 30, 2019
  2. added
    pending-discussion
    on Jul 30, 2019
  3. garethgreenaway commented on Jul 30, 2019

    @garethgreenaway
    Contributor

    @twangboy Any thoughts on this one?

  4. twangboy commented on Jul 30, 2019

    @twangboy
    Contributor

    @thisnotfunny Hey, thanks for reporting this. I need some more information from you.

    What version of Salt?
    What user are you trying to run as? (System?)
    Are you running a salt command or a salt-call command? Please paste the exact command you're running.
    What are the permissions for the account under which the salt-minion service is running if it's running under something other than SYSTEM?
    What are the permissions for the user you're trying to run as? (Administrator? User?)
    What are the permissions for the account you're using to launch the command?
    How was salt installed? (Using Salt's supplied packages? Installed manually in a python environment?)

  5. thisnotfunny commented on Aug 5, 2019

    @thisnotfunny
    Author

    @garethgreenaway @twangboy
    thanks for help.
    salt master in linux run as root (redhat 6.4)
    salt minion windows version is Salt-Minion-2019.2.0-Py2-AMD64-Setup.exe
    and also run as system(windows2008 32bit / windows 2012 32bit),
    (myuser is not system user)

    I use root to input this command :
    salt ip cmd.run "echo aaa" runas="myuser"

    The minion function caused an exception: Traceback (most recent call last):
      File "C:\salt\bin\lib\site-packages\salt\minion.py", line 1660, in _thread_return
        return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
      File "C:\salt\bin\lib\site-packages\salt\executors\direct_call.py", line 12, in execute
        return func(*args, **kwargs)
      File "C:\salt\bin\lib\site-packages\salt\modules\cmdmod.py", line 1167, in run
        **kwargs)
      File "C:\salt\bin\lib\site-packages\salt\modules\cmdmod.py", line 407, in _run
        return win_runas(cmd, runas, password, cwd)
      File "C:\salt\bin\lib\site-packages\salt\utils\win_runas.py", line 185, in runas
        environment=env,
      File "C:\salt\bin\lib\site-packages\salt\platform\win.py", line 1055, in CreateProcessWithTokenW
        raise exc
    WindowsError: 操作成功完成。
    

    ERROR: Minions returned with non-zero exit code

    If I run 'salt ip cmd.run "echo aaa"' without runas, it work fine.
    If I run 'salt ip cmd.run "echo aaa" runas="system", it will thow different error:
    WindowsError:帐户名与安全标识间无任何映射完成。

  6. stale commented on Jan 7, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Windowspending-discussionstale

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions